Whamcloud - gitweb
Branch HEAD
authorjohann <johann>
Wed, 5 Dec 2007 17:24:03 +0000 (17:24 +0000)
committerjohann <johann>
Wed, 5 Dec 2007 17:24:03 +0000 (17:24 +0000)
b=12829
i=adilger
i=bobijam

When CRAY_XT3 is defined, the fsgid supplied by the client is
overridden with the primary group provided by the group upcall,
whereas the supplied fsgid can be trusted if it is in the list of
supplementary groups returned by the group upcall.

lustre/ChangeLog
lustre/mds/mds_reint.c
lustre/tests/sanity.sh

index 2cb5668..1683f34 100644 (file)
@@ -517,6 +517,16 @@ Description: parallel lock callbacks
 Details    : Instead of sending blocking and completion callbacks as separated
              requests, adding them to a set and sending in parallel.
 
+Severity   : normal
+Frequency  : only for Cray XT3
+Bugzilla   : 12829/13455
+Description: Changing primary group doesn't change the group lustre assigns to
+            a file
+Details    : When CRAY_XT3 is defined, the fsgid supplied by the client is
+            overridden with the primary group provided by the group upcall,
+            whereas the supplied fsgid can be trusted if it is in the list of
+            supplementary groups returned by the group upcall.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
index e1956b6..eec3581 100644 (file)
@@ -2351,6 +2351,9 @@ int mds_reint_rec(struct mds_update_record *rec, int offset,
         struct obd_device *obd = req->rq_export->exp_obd;
 #if 0
         struct mds_obd *mds = &obd->u.mds;
+#ifdef CRAY_XT3
+        gid_t fsgid = rec->ur_uc.luc_fsgid;
+#endif
 #endif
         struct lvfs_run_ctxt saved;
         int rc;
@@ -2389,6 +2392,17 @@ int mds_reint_rec(struct mds_update_record *rec, int offset,
 #endif
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
+
+#if 0
+#ifdef CRAY_XT3
+        if (rec->ur_uc.luc_uce && fsgid != rec->ur_uc.luc_fsgid &&
+            in_group_p(fsgid)) {
+                rec->ur_uc.luc_fsgid = fsgid;
+                current->fsgid = saved.luc.luc_fsgid = fsgid;
+        }
+#endif
+#endif
+
         rc = reinters[rec->ur_opcode] (rec, offset, req, lockh);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
 
index 39c0bdc..6e0de6e 100644 (file)
@@ -4795,6 +4795,15 @@ test_125() { # 13358
 }
 run_test 125 "don't return EPROTO when a dir has a non-default striping and ACLs"
 
+test_126() { # bug 12829/13455
+       [ "$UID" != 0 ] && echo "skipping $TESTNAME (must run as root)" && return
+       $RUNAS -u 0 -g 1 touch $DIR/$tfile || error "touch failed"
+       gid=`ls -n $DIR/$tfile | awk '{print $4}'`
+       rm -f $DIR/$tfile
+       [ $gid -eq "1" ] || error "gid is set to" $gid "instead of 1"
+}
+run_test 126 "check that the fsgid provided by the client is taken into account"
+
 TMPDIR=$OLDTMPDIR
 TMP=$OLDTMP
 HOME=$OLDHOME