Whamcloud - gitweb
LU-5424 mdt: allow open by FID to create striping 48/11248/4
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 28 Jul 2014 14:49:49 +0000 (09:49 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 Aug 2014 17:30:49 +0000 (17:30 +0000)
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 <john.hammond@intel.com>
Change-Id: I4d948d83dca8a542b15945d8bf3b9feaded0f5ef
Reviewed-on: http://review.whamcloud.com/11248
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
lustre/mdt/mdt_open.c
lustre/tests/sanity.sh

index 62e2aa2..b9022e4 100644 (file)
@@ -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);
 }
index bc6fb0b..057be2a 100644 (file)
@@ -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