linux_dsm_epyc7002/fs/xfs/linux-2.6
Lachlan McIlroy 25051158bb [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>
2008-12-24 14:07:32 +11:00
..
kmem.c [XFS] kmem_free and kmem_realloc to use const void * 2008-07-28 16:58:43 +10:00
kmem.h [XFS] kmem_free and kmem_realloc to use const void * 2008-07-28 16:58:43 +10:00
mrlock.h [XFS] shrink mrlock_t 2008-04-29 15:54:02 +10:00
mutex.h [XFS] mutex fallout - fix debug builds and remove no-longer-useful comment. 2006-01-16 16:21:34 +11:00
sv.h remove dead code from sv_t implementation 2008-12-04 15:39:21 +11:00
time.h [XFS] Update license/copyright notices to match the prefered SGI 2005-11-02 14:58:39 +11:00
xfs_aops.c move vn_iowait / vn_iowake into xfs_aops.c 2008-12-04 15:39:24 +11:00
xfs_aops.h move vn_iowait / vn_iowake into xfs_aops.c 2008-12-04 15:39:24 +11:00
xfs_buf.c Merge branch 'master' of git+ssh://git.melbourne.sgi.com/git/xfs 2008-12-12 15:28:02 +11:00
xfs_buf.h [XFS] Remove XFS_BUF_SHUT() and friends 2008-12-22 17:52:58 +11:00
xfs_cred.h CRED: Wrap task credential accesses in the XFS filesystem 2008-10-31 15:50:04 +11:00
xfs_dmapi_priv.h [XFS] Remove KERNEL_VERSION macros from xfs_dmapi.h 2006-11-11 18:05:06 +11:00
xfs_export.c [XFS] remove xfs_vfsops.h 2008-12-01 11:37:06 +11:00
xfs_export.h xfs: new export ops 2007-10-22 08:13:20 -07:00
xfs_file.c [XFS] Use the incore inode size in xfs_file_readdir() 2008-12-22 17:50:56 +11:00
xfs_fs_subr.c [XFS] fix error inversion problems with data flushing 2008-12-01 11:11:10 +11:00
xfs_fs_subr.h [XFS] decontaminate vnode operations from behavior details 2007-10-15 16:54:29 +10:00
xfs_globals.c [XFS] remove restricted chown parameter from xfs linux 2008-10-30 18:30:48 +11:00
xfs_globals.h [XFS] kill sys_cred 2008-10-30 18:27:48 +11:00
xfs_ioctl32.c [XFS] add a FMODE flag to make XFS invisible I/O less hacky 2008-12-11 13:14:41 +11:00
xfs_ioctl32.h [XFS] fix compile on 32 bit systems 2008-12-04 13:07:29 +11:00
xfs_ioctl.c [XFS] add a FMODE flag to make XFS invisible I/O less hacky 2008-12-11 13:14:41 +11:00
xfs_ioctl.h [XFS] add a FMODE flag to make XFS invisible I/O less hacky 2008-12-11 13:14:41 +11:00
xfs_iops.c kill dead inode flags 2008-12-04 15:39:22 +11:00
xfs_iops.h [XFS] add a FMODE flag to make XFS invisible I/O less hacky 2008-12-11 13:14:41 +11:00
xfs_linux.h [XFS] remove xfs_vfs.h 2008-12-01 11:36:59 +11:00
xfs_lrw.c [XFS] Fix race in xfs_write() between direct and buffered I/O with DMAPI 2008-12-24 14:07:32 +11:00
xfs_lrw.h [XFS] remove sendfile leftovers 2008-04-29 16:08:14 +10:00
xfs_stats.c [XFS] fix spurious gcc warnings 2008-12-01 11:07:37 +11:00
xfs_stats.h [XFS] add new btree statistics 2008-10-30 16:55:03 +11:00
xfs_super.c move vn_iowait / vn_iowake into xfs_aops.c 2008-12-04 15:39:24 +11:00
xfs_super.h remove unused behvavior cruft in xfs_super.h 2008-12-04 15:39:19 +11:00
xfs_sync.c [XFS] Remove unnecessary assertion 2008-12-05 14:15:49 +11:00
xfs_sync.h [XFS] mark inodes for reclaim via a tag in the inode radix tree 2008-10-30 17:37:26 +11:00
xfs_sysctl.c [XFS] remove restricted chown parameter from xfs linux 2008-10-30 18:30:48 +11:00
xfs_sysctl.h [XFS] remove restricted chown parameter from xfs linux 2008-10-30 18:30:48 +11:00
xfs_version.h [XFS] Update license/copyright notices to match the prefered SGI 2005-11-02 14:58:39 +11:00
xfs_vnode.h move inode tracing out of xfs_vnode. 2008-12-04 15:39:25 +11:00
xfs_xattr.c [XFS] Remove vn_revalidate calls in xfs. 2008-07-28 16:59:39 +10:00