Skip to contentSkip to conversation

review: don't block non-blocking setattr when frozen

DISCUSSION David Chinner 2 participants 2 messages Apr 23, 2007

lore
Share & tools
lore
#0 lore raw

Prevent nfsds from blocking doing on setattr calls (i.e. truncates) when the filesystem is frozen or being frozen.

Cheers,

Dave.

Signature · 24 lines
Dave Chinner
Principal Engineer
SGI Australian Software Group

---
 fs/xfs/xfs_vnodeops.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c	2007-01-31 13:56:03.781573432 +1100
+++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c	2007-01-31 13:56:13.428316729 +1100
@@ -281,6 +281,12 @@ xfs_setattr(
 		return XFS_ERROR(EINVAL);
 	}
 
+	/*
+	 * Don't block if the filesystem is frozen.
+	 */
+	if ((flags & ATTR_NONBLOCK) && vfs_test_for_freeze(vp->v_vfsp))
+		return XFS_ERROR(EAGAIN);
+
 	ip = XFS_BHVTOI(bdp);
 	mp = ip->i_mount;
#1 lore raw
Quoted 3 lines · David Chinner

Prevent nfsds from blocking doing on setattr calls (i.e. truncates) when the filesystem is frozen or being frozen.

Ok with same caveat as the last one.