diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-24 14:07:32 +1100 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-24 14:07:32 +1100 |
commit | 25051158bbed127e8672b43396c71c5eb610e5f1 (patch) | |
tree | ee93995d39c50956334157ca723f980f5d9fa7d2 /net/8021q | |
parent | ad1ad968f4e7b06c75741575ea077e25a87da49a (diff) | |
download | op-kernel-dev-25051158bbed127e8672b43396c71c5eb610e5f1.zip op-kernel-dev-25051158bbed127e8672b43396c71c5eb610e5f1.tar.gz |
[XFS] Fix race in xfs_write() between direct and buffered I/O with DMAPI
The iolock is dropped and re-acquired around the call to XFS_SEND_NAMESP().
While the iolock is released the file can become cached. We then
'goto retry' and - if we are doing direct I/O - mapping->nrpages may now be
non zero but need_i_mutex will be zero and we will hit the WARN_ON().
Since we have dropped the I/O lock then the file size may have also changed
so what we need to do here is 'goto start' like we do for the XFS_SEND_DATA()
DMAPI event.
We also need to update the filesize before releasing the iolock so that
needs to be done before the XFS_SEND_NAMESP event. If we drop the iolock
before setting the filesize we could race with a truncate.
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'net/8021q')
0 files changed, 0 insertions, 0 deletions