public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* review: don't block non-blocking setattr when frozen
@ 2007-04-23  0:31 David Chinner
  2007-04-23 21:27 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: David Chinner @ 2007-04-23  0:31 UTC (permalink / raw)
  To: xfs-dev; +Cc: xfs-oss


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;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-23 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-23  0:31 review: don't block non-blocking setattr when frozen David Chinner
2007-04-23 21:27 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox