xfs
[Top] [All Lists]

Re: [PATCH] xfs: avoid direct I/O write vs buffered I/O race

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: avoid direct I/O write vs buffered I/O race
From: Alex Elder <aelder@xxxxxxx>
Date: Mon, 12 Sep 2011 13:43:36 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <20110827144253.GA16381@xxxxxxxxxxxxx>
References: <20110827144253.GA16381@xxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
On Sat, 2011-08-27 at 10:42 -0400, Christoph Hellwig wrote:
> Currently a buffered reader or writer can add pages to the pagecache
> while we are waiting for the iolock in xfs_file_dio_aio_write.  Prevent
> this by re-checking mapping->nrpages after we got the iolock, and if
> nessecary upgrade the lock to exclusive mode.  To simplify this a bit
> only take the ilock inside of xfs_file_aio_write_checks.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

I agree with Dave, moving the ILOCK acquisition into
xfs_file_aio_write_checks() is very nice.

In any case the core change looks good.

Reviewed-by: Alex Elder <aelder@xxxxxxx>


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] xfs: avoid direct I/O write vs buffered I/O race, Alex Elder <=