From: John L. Hammond Date: Mon, 28 Jul 2014 14:49:49 +0000 (-0500) Subject: LU-5424 mdt: allow open by FID to create striping X-Git-Tag: 2.6.51~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=55ba9897d156399ab4ccb1626866f87565a24cbe LU-5424 mdt: allow open by FID to create striping In mdt_create_data() remove the check on parent that prevent open by FID from creating striping. In sanity.sh check that open by FID may create striping. Signed-off-by: John L. Hammond Change-Id: I4d948d83dca8a542b15945d8bf3b9feaded0f5ef Reviewed-on: http://review.whamcloud.com/11248 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi --- diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 62e2aa2..b9022e4 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -123,9 +123,6 @@ static int mdt_create_data(struct mdt_thread_info *info, ma->ma_valid = 0; mutex_lock(&o->mot_lov_mutex); if (!(o->mot_flags & MOF_LOV_CREATED)) { - if (p != NULL && !fid_is_md_operative(mdt_object_fid(p))) - GOTO(unlock, rc = -EPERM); - rc = mdo_create_data(info->mti_env, p ? mdt_object_child(p) : NULL, mdt_object_child(o), spec, ma); @@ -135,7 +132,7 @@ static int mdt_create_data(struct mdt_thread_info *info, if (rc == 0 && ma->ma_valid & MA_LOV) o->mot_flags |= MOF_LOV_CREATED; } -unlock: + mutex_unlock(&o->mot_lov_mutex); RETURN(rc); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index bc6fb0b..057be2a 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9573,9 +9573,13 @@ dot_lustre_fid_permission_check() { $OPENFILE -f O_LOV_DELAY_CREATE:O_CREAT $test_dir/$tfile-2 fid=$($LFS path2fid $test_dir/$tfile-2) - echo "cp /etc/passwd $MOUNT/.lustre/fid/$fid" - cp /etc/passwd $MOUNT/.lustre/fid/$fid && - error "create lov data thru .lustre should fail." + + if [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.6.50) ] + then # LU-5424 + echo "cp /etc/passwd $MOUNT/.lustre/fid/$fid" + cp /etc/passwd $MOUNT/.lustre/fid/$fid || + error "create lov data thru .lustre failed" + fi echo "cp /etc/passwd $test_dir/$tfile-2" cp /etc/passwd $test_dir/$tfile-2 || error "copy to $test_dir/$tfile-2 failed." @@ -9644,7 +9648,7 @@ test_154b() { local rc=0 mkdir -p $DIR/$tdir - $LFS mkdir -i $MDTIDX -c $MDSCOUNT $remote_dir || + $LFS mkdir -i $MDTIDX $remote_dir || error "create remote directory failed" cp /etc/hosts $remote_dir/$tfile