Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-16 Thread Vitaly Mayatskih
We saw it as well (and fixed a bit differently, because of kpatch). Here's the reproducer, triggers the bug within few seconds for i in {0..3}; do dd if=/dev/zero of=/dev/shm/$i bs=512M count=1 losetup /dev/loop$((4+i)) /dev/shm/$i done sleep 1 yes | mdadm -C /dev/md0 -l10 -n4 --assume-

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-14 Thread Junxiao Bi
On 7/14/20 9:18 AM, Song Liu wrote: On Mon, Jul 13, 2020 at 11:41 PM Junxiao Bi wrote: On 7/13/20 11:17 PM, Song Liu wrote: On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: The following deadlock was captured. The first process is holding 'kernfs_mutex' and hung by io. The io was staging i

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-14 Thread Song Liu
On Mon, Jul 13, 2020 at 11:41 PM Junxiao Bi wrote: > > On 7/13/20 11:17 PM, Song Liu wrote: > > > On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: > >> The following deadlock was captured. The first process is holding > >> 'kernfs_mutex' > >> and hung by io. The io was staging in 'r1conf.pending

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-13 Thread Junxiao Bi
On 7/13/20 11:17 PM, Song Liu wrote: On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: The following deadlock was captured. The first process is holding 'kernfs_mutex' and hung by io. The io was staging in 'r1conf.pending_bio_list' of raid1 device, this pending bio list would be flushed by seco

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-13 Thread Song Liu
On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: > > The following deadlock was captured. The first process is holding > 'kernfs_mutex' > and hung by io. The io was staging in 'r1conf.pending_bio_list' of raid1 > device, > this pending bio list would be flushed by second process 'md127_raid1', b

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-13 Thread Junxiao Bi
Anybody help take a look at this deadlock? Issue happened when raid_check was running, at that time, system memory was not enough, one process which was doing path lookup from sysfs triggered the direct memory reclaim, it was holding filesystem mutex 'kernelfs_mutex' and hung by io. The io wou

[PATCH] md: fix deadlock causing by sysfs_notify

2020-07-09 Thread Junxiao Bi
The following deadlock was captured. The first process is holding 'kernfs_mutex' and hung by io. The io was staging in 'r1conf.pending_bio_list' of raid1 device, this pending bio list would be flushed by second process 'md127_raid1', but it was hung by 'kernfs_mutex'. Using sysfs_notify_dirent_safe