From 585bcc48e77313ecbca99b442e9abc7602469f62 Mon Sep 17 00:00:00 2001 From: johann Date: Wed, 5 Dec 2007 17:24:03 +0000 Subject: [PATCH] Branch HEAD 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 | 10 ++++++++++ lustre/mds/mds_reint.c | 14 ++++++++++++++ lustre/tests/sanity.sh | 9 +++++++++ 3 files changed, 33 insertions(+) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 2cb5668..1683f34 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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. diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index e1956b6..eec3581 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -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); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 39c0bdc..6e0de6e 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 -- 1.8.3.1