Whamcloud - gitweb
LU-13190 mds: send mbo_max_mdsize in open intent reply 00/37400/6
authorAlex Zhuravlev <bzzz@whamcloud.com>
Sun, 2 Feb 2020 13:45:29 +0000 (16:45 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 20 Feb 2020 07:14:58 +0000 (07:14 +0000)
 - client sends open|create intent before a connection to OST
   cl_default_mds_easize is 0 since initialization
 - MDS replies back without UPDATE bit in LDLM lock, but wit EAh
    (MDS doesn't send OBD_MD_FLMODEASIZE and mbo_max_mdsize back
 - client's cl_default_mds_easize is still 0
 - client sends getattr intent with 0-size buffer for EA
 - MDS replies LAYOUT lock, but empty EA due to 0-size buffer
 - client sets local layout to EMPTY
 - all subsequent I/O fails with -EBADF

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Iadd5595d956f0469e3916cdc1cca2ac8f802a149
Reviewed-on: https://review.whamcloud.com/37400
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_open.c
lustre/tests/sanity.sh

index ae3cb8e..98f80b8 100644 (file)
@@ -1575,6 +1575,9 @@ again:
                }
        }
 
+       repbody->mbo_max_mdsize = info->mti_mdt->mdt_max_mdsize;
+       repbody->mbo_valid |= OBD_MD_FLMODEASIZE;
+
        rc = mdt_pack_secctx_in_reply(info, child);
        if (unlikely(rc))
                GOTO(out_child, result = rc);
index 8ac8138..e24e301 100755 (executable)
@@ -23001,6 +23001,42 @@ test_819b() {
 }
 run_test 819b "too big niobuf in write"
 
+
+function test_820_start_ost() {
+       sleep 5
+
+       for num in $(seq $OSTCOUNT); do
+               start ost$num $(ostdevname $num) $OST_MOUNT_OPTS
+       done
+}
+
+test_820() {
+       [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
+
+       mkdir $DIR/$tdir
+       umount_client $MOUNT || error "umount failed"
+       for num in $(seq $OSTCOUNT); do
+               stop ost$num
+       done
+
+       # mount client with no active OSTs
+       # so that the client can't initialize max LOV EA size
+       # from OSC notifications
+       mount_client $MOUNT || error "mount failed"
+       # delay OST starting to keep this 0 max EA size for a while
+       test_820_start_ost &
+
+       # create a directory on MDS2
+       test_mkdir -i 1 -c1 $DIR/$tdir/mds2 ||
+               error "Failed to create directory"
+       # open intent should update default EA size
+       # see mdc_update_max_ea_from_body()
+       # notice this is the very first RPC to MDS2
+       cp /etc/services $DIR/$tdir/mds2 ||
+               error "Failed to copy files to mds$n"
+}
+run_test 820 "update max EA from open intent"
+
 #
 # tests that do cleanup/setup should be run at the end
 #