[SSI] openssi/kernel/cluster/ssi/cfs dir.c,1.31,1.32

Roger Tsang <[email protected]> Sun, 29 Aug 2010 17:42:38 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv18283/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	dir.c 
Log Message:
- cfs_rename(): remove redundant permissions check when the file stays in the same directory.
- cfs_rename(): re-check after obtaining tokens whether we can change '..' when moving directory to a different parent directory.


Index: dir.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/dir.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- dir.c	5 Mar 2010 06:15:04 -0000	1.31
+++ dir.c	29 Aug 2010 17:42:36 -0000	1.32
@@ -1668,10 +1668,18 @@
 #endif
 
 	/*  Check out the new directory  */
+	if (ndir != odir) {
+		if (dir_rename) {
+			/* re-check for vfs_rename_dir() */
+			error = _cfs_permission(ip, MAY_WRITE);
+			if (error)
+				goto fail_gunlock;
+		}
 
-	error = _cfs_permission(ndir, MAY_WRITE | MAY_EXEC);
-	if (error)
-		goto fail_gunlock;
+		error = _cfs_permission(ndir, MAY_WRITE | MAY_EXEC);
+		if (error)
+			goto fail_gunlock;
+	}
 
 #ifdef SSI_CFS_SKIP
 /* Paranoid? */


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d