[PATCH 12/14] xfs: validate COW fork sequence counters during buffered writes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

In the previous patch, we transformed the iomap revalidation code to use
an explicit context object where data and cow fork sequence counters are
tracked explicitly.  The existing validation function only validated the
data fork sequence counter, so now let's make it validate both.

I /think/ this isn't actually necessary here because we're writing to
the page cache, and the page state does not track or care about cow
status.  However, this question came up when Dave and I were chatting
about this patchset on IRC, so here it is for formal consideration.

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
 fs/xfs/xfs_iomap.c |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index c3c23524a3d2..5e746df2c63f 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1370,6 +1370,9 @@ xfs_buffered_write_iomap_valid(
 
 	if (ibc->data_seq != READ_ONCE(ip->i_df.if_seq))
 		return false;
+	if (ibc->has_cow_seq &&
+	    ibc->cow_seq != READ_ONCE(ip->i_cowfp->if_seq))
+		return false;
 	return true;
 }
 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux