xfs
[Top] [All Lists]

Re: [PATCH] ext4: fix race aio-dio vs freeze_fs

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] ext4: fix race aio-dio vs freeze_fs
From: Jan Kara <jack@xxxxxxx>
Date: Wed, 25 Nov 2015 11:25:00 +0100
Cc: Jan Kara <jack@xxxxxxx>, Dmitry Monakhov <dmonakhov@xxxxxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, tytso@xxxxxxx, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20151124160723.GA17466@xxxxxxxxxxxxx>
References: <1448294568-20892-1-git-send-email-dmonakhov@xxxxxxxxxx> <20151124132421.GG25232@xxxxxxxxxxxxx> <20151124160723.GA17466@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue 24-11-15 08:07:23, Christoph Hellwig wrote:
> On Tue, Nov 24, 2015 at 02:24:21PM +0100, Jan Kara wrote:
> > Well, this problem seems to suggest that we have the freeze protection for
> > AIO writes wrong. We should call file_end_write() from aio_complete() and
> > not from aio_run_iocb()... I believe XFS and other filesystems may have
> > problems with this as well (CCed). Attached patch (so far only compile
> > tested since my test machine is pondering on something else) should fix
> > this.
> 
> Sounds like one way to do it, but we'd really want a vfs_* helper for
> this so that it doesn't have to duplicated in other write_iter users
> like the loop driver, which seems to be missing file
> file_start_write/file_end_write entirely.

That is mostly a separate issue, isn't it? I guess you mean a helper like
vfs_write_iter() that would get freeze protection and call ->write_iter()?
And what about files which have ->write (or ->splice_write()) and don't end
up calling ->write_iter? Also there is stuff like __kernel_write() which
ends up calling ->write_iter() but e.g. kernel/acct.c: do_acct_process()
wants to do it's own thing...

So the current status is not ideal but I don't see how to make it
substantially better...

                                                                Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR

<Prev in Thread] Current Thread [Next in Thread>