[f2fs-dev] [PATCH] f2fs: Prevent s_writer rw_sem count mismatch in f2fs_evict_inode

2024-03-21 Thread Yeongjin Gil
If f2fs_evict_inode is called between freeze_super and thaw_super, the s_writer rwsem count may become negative, resulting in hang. CPU1 CPU2 f2fs_resize_fs() f2fs_evict_inode() f2fs_freeze set SBI_IS_FREEZING skip

Re: [f2fs-dev] 回覆: 回覆: f2fs F2FS_IOC_SHUTDOWN hang issue

2024-03-21 Thread Jaegeuk Kim
On 03/21, Light Hsieh (謝明燈) wrote: > Do you mean: > > +   /* Avoid the deadlock from F2FS_GOING_DOWN_NOSYNC. */ > +   if (!sb_start_intwrite_trylock(sbi->sb)) > + continue; > > After failure of trylock, the 'continue' make code flow goto the line: >   }

Re: [f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-21 Thread Jaegeuk Kim
On 03/22, Hillf Danton wrote: > On Tue, 19 Mar 2024 17:14:42 -0700 Jaegeuk Kim > > f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC) issue_discard_thread > > - mnt_want_write_file() > >- sb_start_write(SB_FREEZE_WRITE) >__sb_start_write() > percpu_down_read() > >

Re: [f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-21 Thread Hillf Danton
On Tue, 19 Mar 2024 17:14:42 -0700 Jaegeuk Kim > f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC) issue_discard_thread > - mnt_want_write_file() >- sb_start_write(SB_FREEZE_WRITE) __sb_start_write() percpu_down_read() > - >