xfs
[Top] [All Lists]

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

To: xfs-dev <xfs-dev@xxxxxxx>
Subject: review: don't block non-blocking setattr when frozen
From: David Chinner <dgc@xxxxxxx>
Date: Mon, 23 Apr 2007 10:31:42 +1000
Cc: xfs-oss <xfs@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
Prevent nfsds from blocking doing on setattr calls (i.e. truncates)
when the filesystem is frozen or being frozen.

Cheers,

Dave.
-- 
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;
 


<Prev in Thread] Current Thread [Next in Thread>