From: Christoph Hellwig Date: Sat, 27 Aug 2011 14:42:53 +0000 (+0000) Subject: xfs: avoid direct I/O write vs buffered I/O race X-Git-Tag: v3.2-rc1~134^2~55 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c58cb165bd44de8aaee9755a144136ae743be116;p=pandora-kernel.git xfs: avoid direct I/O write vs buffered I/O race 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 Reviewed-by: Dave Chinner Signed-off-by: Alex Elder --- Reading git-diff-tree failed