[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240321224233.2541-1-hdanton@sina.com>
Date: Fri, 22 Mar 2024 06:42:33 +0800
From: Hillf Danton <hdanton@...a.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Light Hsieh (謝明燈) <Light.Hsieh@...iatek.com>,
linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [PATCH] f2fs: avoid the deadlock case when stopping discard thread
On Tue, 19 Mar 2024 17:14:42 -0700 Jaegeuk Kim <jaegeuk@...nel.org>
> 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()
> - sb_start_intwrite(SB_FREEZE_FS);
__sb_start_write()
percpu_down_read()
Given lock acquirers for read on both sides, wtf deadlock are you fixing?
> - f2fs_stop_checkpoint(sbi, false, : waiting
> STOP_CP_REASON_SHUTDOWN);
> - f2fs_stop_discard_thread(sbi);
> - kthread_stop()
> : waiting
>
> - mnt_drop_write_file(filp);
More important, feel free to add in spin.
Reported-by: "Light Hsieh (謝明燈)" <Light.Hsieh@...iatek.com>
Powered by blists - more mailing lists