]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: lustre: mdt: extra checking for getattr RPC.
authorwang di <di.wang@intel.com>
Wed, 4 May 2016 14:28:55 +0000 (10:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2016 12:01:14 +0000 (14:01 +0200)
Check whether getattr RPC can hold layout MD(RMF_MDT_MD),
in case the client sends some invalid RPC, which can
cause panic on MDT.

Client will retrieve cl_max_md_size/cl_default_md_size
from MDS during mount process, so it will initialize
cl_max_md_size/cl_default_md_size before sending getattr
to MDS.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4222
Reviewed-on: http://review.whamcloud.com/8599
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/mdc/mdc_request.c

index 64be2c1140f56228b7156e750eb8e4b218bb61a6..44dd3f31fd3b2c636032a954be51ce79ef5e7e20 100644 (file)
@@ -445,7 +445,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        /* make root inode
         * XXX: move this to after cbd setup?
         */
-       valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS;
+       valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS | OBD_MD_FLMODEASIZE;
        if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
                valid |= OBD_MD_FLRMTPERM;
        else if (sbi->ll_flags & LL_SBI_ACL)
index 46e3a750670336eef2f3587901c9348d21b3b16f..86b7445365f43b2c16ace7e57b0ec57d26e2605a 100644 (file)
@@ -142,9 +142,8 @@ static int mdc_getattr_common(struct obd_export *exp,
 
        CDEBUG(D_NET, "mode: %o\n", body->mode);
 
+       mdc_update_max_ea_from_body(exp, body);
        if (body->eadatasize != 0) {
-               mdc_update_max_ea_from_body(exp, body);
-
                eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
                                                      body->eadatasize);
                if (!eadata)