From 3f96890a5ba777f94dca54a9fdb128fc0f41b60c Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 2 Jun 2005 18:10:36 +0000 Subject: [PATCH] Branch b1_4 Setting a default stripe on the filesystem root prevented the filesystem from being remounted. The client was sending extra request flags in the root getattr request and did not allocate a reply buffer for the dir EA. b=6367 r=phil --- lustre/ChangeLog | 12 ++++++++++++ lustre/include/linux/lustre_idl.h | 10 +++++----- lustre/liblustre/super.c | 4 ++-- lustre/llite/dir.c | 11 +++-------- lustre/llite/file.c | 2 +- lustre/llite/llite_lib.c | 5 ++--- lustre/tests/sanity.sh | 16 ++++++++++++++-- 7 files changed, 39 insertions(+), 21 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 1f5faab..fcd7147 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -1,4 +1,16 @@ tbd Cluster File Systems, Inc. + * version 1.4.4 + * bug fixes + +Severity : major +Frequency : Only if a default stripe is set on the filesystem root. +Bugzilla : 6367 +Description: Setting a default stripe on the filesystem root prevented the + filesystem from being remounted. +Details : The client was sending extra request flags in the root getattr + request and did not allocate a reply buffer for the dir EA. + +tbd Cluster File Systems, Inc. * version 1.4.3 * bug fixes diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 1c0f97f..d80b7e6 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -370,11 +370,11 @@ struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */ #define OBD_MD_MDS (0x100000000ULL) /* where an inode lives on */ #define OBD_MD_REINT (0x200000000ULL) /* reintegrate oa */ -#define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME|\ - OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | OBD_MD_FLCKSUM|\ - OBD_MD_FLQOS | OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE|\ - OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)) - +#define OBD_MD_FLGETATTR (OBD_MD_FLID | OBD_MD_FLATIME | OBD_MD_FLMTIME | \ + OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \ + OBD_MD_FLMODE | OBD_MD_FLTYPE | OBD_MD_FLUID | \ + OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \ + OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP) static inline struct lustre_handle *obdo_handle(struct obdo *oa) { diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 6476c6e..d4bd1bf 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -429,7 +429,7 @@ static int llu_inode_revalidate(struct inode *inode) struct ptlrpc_request *req = NULL; struct llu_sb_info *sbi = llu_i2sbi(inode); struct ll_fid fid; - unsigned long valid = 0; + unsigned long valid = OBD_MD_FLGETATTR; int rc, ealen = 0; /* Why don't we update all valid MDS fields here, if we're @@ -1748,7 +1748,7 @@ llu_fsswop_mount(const char *source, /* fetch attr of root inode */ err = mdc_getattr(sbi->ll_mdc_exp, &rootfid, - OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request); + OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS, 0, &request); if (err) { CERROR("mdc_getattr failed for root: rc = %d\n", err); GOTO(out_osc, err); diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 8a0b74e..a6e63bc 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -421,7 +421,6 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, char *buf = NULL; char *filename; int namelen, rc, len = 0; - unsigned long valid; rc = obd_ioctl_getdata(&buf, &len, (void *)arg); if (rc) @@ -436,10 +435,9 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, GOTO(out, rc = -EINVAL); } - valid = OBD_MD_FLID; ll_inode2fid(&fid, inode); - rc = mdc_getattr_name(sbi->ll_mdc_exp, &fid, - filename, namelen, valid, 0, &request); + rc = mdc_getattr_name(sbi->ll_mdc_exp, &fid, filename, namelen, + OBD_MD_FLID, 0, &request); if (rc < 0) { CDEBUG(D_INFO, "mdc_getattr_name: %d\n", rc); GOTO(out, rc); @@ -498,13 +496,10 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, struct lov_mds_md *lmm; struct ll_fid fid; struct mds_body *body; - unsigned long valid = 0; int rc, lmmsize; - valid |= OBD_MD_FLDIREA; - ll_inode2fid(&fid, inode); - rc = mdc_getattr(sbi->ll_mdc_exp, &fid, valid, + rc = mdc_getattr(sbi->ll_mdc_exp, &fid, OBD_MD_FLDIREA, obd_size_diskmd(sbi->ll_osc_exp, NULL), &request); if (rc < 0) { diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 799b607..94338d6 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1391,7 +1391,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it) struct ptlrpc_request *req = NULL; struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode); struct ll_fid fid; - unsigned long valid = 0; + unsigned long valid = OBD_MD_FLGETATTR; int ealen = 0; if (S_ISREG(inode->i_mode)) { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 8f0af50..7076509 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -230,7 +230,7 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc) /* make root inode * XXX: move this to after cbd setup? */ err = mdc_getattr(sbi->ll_mdc_exp, &rootfid, - OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request); + OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS, 0, &request); if (err) { CERROR("mdc_getattr failed for root: rc = %d\n", err); GOTO(out_osc, err); @@ -1391,11 +1391,10 @@ int ll_iocontrol(struct inode *inode, struct file *file, switch(cmd) { case EXT3_IOC_GETFLAGS: { struct ll_fid fid; - unsigned long valid = OBD_MD_FLFLAGS; struct mds_body *body; ll_inode2fid(&fid, inode); - rc = mdc_getattr(sbi->ll_mdc_exp, &fid, valid, 0, &req); + rc = mdc_getattr(sbi->ll_mdc_exp, &fid, OBD_MD_FLFLAGS,0,&req); if (rc) { CERROR("failure %d inode %lu\n", rc, inode->i_ino); RETURN(-abs(rc)); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8c540cc..f27b7cb 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -55,14 +55,12 @@ SAVE_PWD=$PWD clean() { echo -n "cln.." sh llmountcleanup.sh ${FORCE} > /dev/null || exit 20 - I_MOUNTED=no } CLEAN=${CLEAN:-:} start() { echo -n "mnt.." sh llrmount.sh > /dev/null || exit 10 - I_MOUNTED=yes echo "done" } START=${START:-:} @@ -2266,6 +2264,20 @@ test_65h() { } run_test 65h "directory stripe info inherit ======" +test_65i() { # bug6367 + $LSTRIPE $MOUNT 65536 -1 -1 +} +run_test 65i "set default striping on root directory (bug 6367)=" + +test_65j() { # bug6367 + # if we aren't already remounting for each test, do so for this test + if [ "$CLEAN" = ":" ]; then + clean || error "failed to unmount" + start || error "failed to remount" + fi +} +run_test 65j "get default striping on root directory (bug 6367)=" + # bug 2543 - update blocks count on client test_66() { COUNT=${COUNT:-8} -- 1.8.3.1