Thread (3 messages) 3 messages, 3 authors, 2011-09-12

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

From: Dave Chinner <david@fromorbit.com>
Date: 2011-08-30 06:29:30

On Sat, Aug 27, 2011 at 10:42:53AM -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@lst.de>
Looks sane. Pushing the ILOCK completely into
xfs_file_aio_write_checks() is a nice segregation of locking
responsibilities.

Reviewed-by: Dave Chinner <redacted>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help