[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ZfzRFU_cXkToBoQ0@google.com>
Date: Thu, 21 Mar 2024 17:30:13 -0700
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: Light Hsieh (謝明燈) <Light.Hsieh@...iatek.com>
Cc: Ed Tsai (蔡宗軒) <Ed.Tsai@...iatek.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-f2fs-devel@...ts.sourceforge.net" <linux-f2fs-devel@...ts.sourceforge.net>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Chun-Hung Wu (巫駿宏) <Chun-hung.Wu@...iatek.com>
Subject: Re: 回覆: 回覆: f2fs
F2FS_IOC_SHUTDOWN hang issue
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:
> } while (!kthread_should_stop());
> Since kthrad_should_stop() is true now, so the issue_discard_thread will end?
Yes, but now I'm confused who is taking write_sem. :(
>
> Light
> ________________________________
> 寄件者: Jaegeuk Kim <jaegeuk@...nel.org>
> 寄件日期: 2024年3月21日 上午 08:39
> 收件者: Light Hsieh (謝明燈) <Light.Hsieh@...iatek.com>
> 副本: Ed Tsai (蔡宗軒) <Ed.Tsai@...iatek.com>; linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>; linux-f2fs-devel@...ts.sourceforge.net <linux-f2fs-devel@...ts.sourceforge.net>; linux-fsdevel@...r.kernel.org <linux-fsdevel@...r.kernel.org>; Chun-Hung Wu (巫駿宏) <Chun-hung.Wu@...iatek.com>
> 主旨: Re: 回覆: f2fs F2FS_IOC_SHUTDOWN hang issue
>
>
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> On 03/20, Light Hsieh (謝明燈) wrote:
> > On 2024/3/20 8:14, Jaegeuk Kim wrote:
> > > f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC) issue_discard_thread
> > > - mnt_want_write_file()
> > > - sb_start_write(SB_FREEZE_WRITE)
> > > - sb_start_intwrite(SB_FREEZE_FS);
> > > - f2fs_stop_checkpoint(sbi, false, : waiting
> > > STOP_CP_REASON_SHUTDOWN);
> > > - f2fs_stop_discard_thread(sbi);
> > > - kthread_stop()
> > > : waiting
> > >
> > > - mnt_drop_write_file(filp);
> > >
> > > Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
> >
> > The case I encounter is f2fs_ic_shutdown with arg F2FS_GOING_DOWN_FULLSYNC, not F2FS_GOING_DOWN_NOSYNC.
> >
> > Or you are meaning that: besides the kernel patch, I need to change the invoked F2FS_IOC_SHUTDOWN to use arg F2FS_GOING_DOWN_NOSYNC?
>
> I think this patch also addresses your case by using trylock.
>
> >
> >
> >
>
Powered by blists - more mailing lists