Whamcloud - gitweb
Branch b1_6
authorjohann <johann>
Wed, 5 Dec 2007 13:58:17 +0000 (13:58 +0000)
committerjohann <johann>
Wed, 5 Dec 2007 13:58:17 +0000 (13:58 +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 trust 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 ed94aa3..30a392b 100644 (file)
@@ -116,6 +116,16 @@ Description: touch file failed when fs is not full
 Details    : OST in recovery should not be discarded by MDS in alloc_qos(),
             otherwise we can get ENOSP while fs is not full.
 
+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 trust if it is in the list of
+            supplementary groups returned by the group upcall.
+
 --------------------------------------------------------------------------------
 
 2007-10-26         Cluster File Systems, Inc. <info@clusterfs.com>
index 869fb27..a7e4da4 100644 (file)
@@ -2352,6 +2352,9 @@ int mds_reint_rec(struct mds_update_record *rec, int offset,
         struct mds_obd *mds = &obd->u.mds;
         struct lvfs_run_ctxt saved;
         int rc;
+#ifdef CRAY_XT3
+        gid_t fsgid = rec->ur_uc.luc_fsgid;
+#endif
         ENTRY;
 
 #ifdef CRAY_XT3
@@ -2385,6 +2388,15 @@ int mds_reint_rec(struct mds_update_record *rec, int offset,
 #endif
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
+
+#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
+
         rc = reinters[rec->ur_opcode] (rec, offset, req, lockh);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
 
index 9e7f183..c3cdf26 100644 (file)
@@ -4781,6 +4781,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