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
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:
> }
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()
> >
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()
> -
>