Whamcloud - gitweb
b=16893
authorgirish <girish>
Wed, 27 May 2009 02:22:48 +0000 (02:22 +0000)
committergirish <girish>
Wed, 27 May 2009 02:22:48 +0000 (02:22 +0000)
i=adilger
i=johann

Lustre changes needed for ext4-ldiskfs support on rhel5 and sles11

lustre/include/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/lvfs/autoMakefile.am
lustre/lvfs/fsfilt_ext3.c
lustre/mds/handler.c
lustre/mds/mds_reint.c
lustre/obdfilter/filter.c
lustre/tests/sanity.sh
lustre/utils/mkfs_lustre.c

index c1c493f..dbeaa1e 100644 (file)
 /* for statfs() */
 #define LL_SUPER_MAGIC 0x0BD00BD0
 
-#ifndef EXT3_IOC_GETFLAGS
-#define EXT3_IOC_GETFLAGS               _IOR('f', 1, long)
-#define EXT3_IOC_SETFLAGS               _IOW('f', 2, long)
-#define EXT3_IOC_GETVERSION             _IOR('f', 3, long)
-#define EXT3_IOC_SETVERSION             _IOW('f', 4, long)
-#define EXT3_IOC_GETVERSION_OLD         _IOR('v', 1, long)
-#define EXT3_IOC_SETVERSION_OLD         _IOW('v', 2, long)
-#define EXT3_IOC_FIEMAP                 _IOWR('f', 11, struct ll_user_fiemap)
-#endif
+#define FSFILT_IOC_GETFLAGS               _IOR('f', 1, long)
+#define FSFILT_IOC_SETFLAGS               _IOW('f', 2, long)
+#define FSFILT_IOC_GETVERSION             _IOR('f', 3, long)
+#define FSFILT_IOC_SETVERSION             _IOW('f', 4, long)
+#define FSFILT_IOC_GETVERSION_OLD         _IOR('v', 1, long)
+#define FSFILT_IOC_SETVERSION_OLD         _IOW('v', 2, long)
+#define FSFILT_IOC_FIEMAP                 _IOWR('f', 11, struct ll_user_fiemap)
 
 /* FIEMAP flags supported by Lustre */
 #define LUSTRE_FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_DEVICE_ORDER)
index 4d52810..301edbf 100644 (file)
@@ -1130,11 +1130,11 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
 
         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1);
         switch(cmd) {
-        case EXT3_IOC_GETFLAGS:
-        case EXT3_IOC_SETFLAGS:
+        case FSFILT_IOC_GETFLAGS:
+        case FSFILT_IOC_SETFLAGS:
                 RETURN(ll_iocontrol(inode, file, cmd, arg));
-        case EXT3_IOC_GETVERSION_OLD:
-        case EXT3_IOC_GETVERSION:
+        case FSFILT_IOC_GETVERSION_OLD:
+        case FSFILT_IOC_GETVERSION:
                 RETURN(put_user(inode->i_generation, (int *)arg));
         /* We need to special case any other ioctls we want to handle,
          * to send them to the MDS/OST as appropriate and to properly
index eca7f74..87b3eeb 100644 (file)
@@ -2737,7 +2737,7 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                 RETURN(ll_lov_getstripe(inode, arg));
         case LL_IOC_RECREATE_OBJ:
                 RETURN(ll_lov_recreate_obj(inode, file, arg));
-        case EXT3_IOC_FIEMAP: {
+        case FSFILT_IOC_FIEMAP: {
                 struct ll_user_fiemap *fiemap_s;
                 size_t num_bytes, ret_bytes;
                 unsigned int extent_count;
@@ -2803,11 +2803,11 @@ error:
                 OBD_VFREE(fiemap_s, num_bytes);
                 RETURN(rc);
         }
-        case EXT3_IOC_GETFLAGS:
-        case EXT3_IOC_SETFLAGS:
+        case FSFILT_IOC_GETFLAGS:
+        case FSFILT_IOC_SETFLAGS:
                 RETURN(ll_iocontrol(inode, file, cmd, arg));
-        case EXT3_IOC_GETVERSION_OLD:
-        case EXT3_IOC_GETVERSION:
+        case FSFILT_IOC_GETVERSION_OLD:
+        case FSFILT_IOC_GETVERSION:
                 RETURN(put_user(inode->i_generation, (int *)arg));
         case LL_IOC_JOIN: {
 #if LUSTRE_FIX >= 50
index 1667144..e4b3342 100644 (file)
@@ -2111,7 +2111,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
         ENTRY;
 
         switch(cmd) {
-        case EXT3_IOC_GETFLAGS: {
+        case FSFILT_IOC_GETFLAGS: {
                 struct ll_fid fid;
                 struct mds_body *body;
 
@@ -2133,7 +2133,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
                 RETURN(put_user(flags, (int *)arg));
         }
-        case EXT3_IOC_SETFLAGS: {
+        case FSFILT_IOC_SETFLAGS: {
                 struct mdc_op_data op_data = { { 0 } };
                 struct ll_iattr_struct attr;
                 struct obd_info oinfo = { { { 0 } } };
index 7bf8727..2443191 100644 (file)
@@ -71,7 +71,9 @@ ldiskfs_sed_flags = \
        -e "s/DX_HASH/EXT3_DX_HASH/g" \
        -e "s/reserve_window/ext3_reserve_window/g" \
        -e "s/rsv_window_add/ext3_rsv_window_add/g" \
-       -e "s/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g"
+       -e "s/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g" \
+       -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g" \
+       -e "s/HAVE_LDISKFS_LDISKFS/HAVE_EXT4_LDISKFS/g"
 
 fsfilt_ldiskfs.c: fsfilt_ext3.c
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
index e981caa..1b50743 100644 (file)
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
-#include <linux/jbd.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/quotaops.h>
+#ifdef HAVE_EXT4_LDISKFS
+#include <ext4/ext4.h>
+#include <ext4/ext4_jbd2.h>
+#else
+#include <linux/jbd.h>
 #include <linux/ext3_fs.h>
 #include <linux/ext3_jbd.h>
+#endif
 #include <linux/version.h>
 #include <linux/bitops.h>
 #include <linux/quota.h>
 #include <linux/lprocfs_status.h>
 
 #ifdef EXT3_MULTIBLOCK_ALLOCATOR
+#ifdef HAVE_EXT4_LDISKFS
+#include <ext4/ext4_extents.h>
+#else
 #include <linux/ext3_extents.h>
 #endif
+#endif
 
 #include "lustre_quota_fmt.h"
 
@@ -109,6 +118,19 @@ struct fsfilt_cb_data {
 #define XATTR_NO_CTIME 0x80
 #endif
 
+#ifdef HAVE_EXT4_LDISKFS
+#define fsfilt_log_start_commit(journal, tid) jbd2_log_start_commit(journal, tid)
+#define fsfilt_log_wait_commit(journal, tid) jbd2_log_wait_commit(journal, tid)
+#define fsfilt_journal_callback_set(handle, func, jcb) jbd2_journal_callback_set(handle, func, jcb)
+#else
+#define fsfilt_log_start_commit(journal, tid) log_start_commit(journal, tid)
+#define fsfilt_log_wait_commit(journal, tid) log_wait_commit(journal, tid)
+#define fsfilt_journal_callback_set(handle, func, jcb) journal_callback_set(handle, func, jcb)
+#define ext_pblock(ex) (ex)->ee_start
+#define ext3_ext_store_pblock(ex, pblock)  ((ex)->ee_start = pblock)
+#define ext3_inode_bitmap(sb,desc) le32_to_cpu((desc)->bg_inode_bitmap)
+#endif
+
 static char *fsfilt_ext3_get_label(struct super_block *sb)
 {
         return EXT3_SB(sb)->s_es->s_volume_name;
@@ -122,7 +144,7 @@ static int fsfilt_ext3_set_label(struct super_block *sb, char *label)
         int err;
 
         journal = EXT3_SB(sb)->s_journal;
-        handle = journal_start(journal, 1);
+        handle = ext3_journal_start_sb(sb, 1);
         if (IS_ERR(handle)) {
                 CERROR("can't start transaction\n");
                 return(PTR_ERR(handle));
@@ -138,7 +160,7 @@ static int fsfilt_ext3_set_label(struct super_block *sb, char *label)
         err = ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
 
 out:
-        journal_stop(handle);
+        ext3_journal_stop(handle);
 
         return(err);
 }
@@ -214,7 +236,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private,
                 nblocks += 3;
                 /* no break */
         case FSFILT_OP_CREATE: {
-#if defined(EXT3_EXTENTS_FL) && defined(EXT3_INDEX_FL)
+#if defined(EXT3_EXTENTS_FL) && defined(EXT3_INDEX_FL) && !defined(HAVE_EXT4_LDISKFS)
                 static int warned;
                 if (!warned) {
                         if (!test_opt(inode->i_sb, EXTENTS)) {
@@ -222,7 +244,8 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private,
                         } else if (((EXT3_I(inode)->i_flags &
                               cpu_to_le32(EXT3_EXTENTS_FL | EXT3_INDEX_FL)) ==
                               cpu_to_le32(EXT3_EXTENTS_FL | EXT3_INDEX_FL))) {
-                                CWARN("extent-mapped directory found - contact "
+                                CWARN("extent-mapped directory found with "
+                                      "ext3-based ldiskfs - contact "
                                       "http://bugzilla.lustre.org/\n");
                                 warned = 1;
                         }
@@ -446,11 +469,11 @@ static int fsfilt_ext3_extend(struct inode *inode, unsigned int nblocks,void *h)
 
        if (handle->h_buffer_credits > nblocks)
                 return 0;
-       if (journal_extend(handle, nblocks) == 0)
+       if (ext3_journal_extend(handle, nblocks) == 0)
                 return 0;
 
        ext3_mark_inode_dirty(handle, inode);
-       return journal_restart(handle, nblocks);
+       return ext3_journal_restart(handle, nblocks);
 }
 
 static int fsfilt_ext3_commit(struct inode *inode, void *h, int force_sync)
@@ -488,7 +511,7 @@ static int fsfilt_ext3_commit_async(struct inode *inode, void *h,
                 CERROR("error while stopping transaction: %d\n", rc);
                 return rc;
         }
-        log_start_commit(journal, tid);
+        fsfilt_log_start_commit(journal, tid);
 
         *wait_handle = (void *) tid;
         CDEBUG(D_INODE, "commit async: %lu\n", (unsigned long) tid);
@@ -504,7 +527,7 @@ static int fsfilt_ext3_commit_wait(struct inode *inode, void *h)
         if (unlikely(is_journal_aborted(journal)))
                 return -EIO;
 
-        log_wait_commit(EXT3_JOURNAL(inode), tid);
+        fsfilt_log_wait_commit(EXT3_JOURNAL(inode), tid);
 
         if (unlikely(is_journal_aborted(journal)))
                 return -EIO;
@@ -578,6 +601,7 @@ static int fsfilt_ext3_iocontrol(struct inode * inode, struct file *file,
                                  unsigned int cmd, unsigned long arg)
 {
         int rc = 0;
+        struct file dummy_file;
         ENTRY;
 
         /* FIXME: Can't do this because of nested transaction deadlock */
@@ -586,8 +610,25 @@ static int fsfilt_ext3_iocontrol(struct inode * inode, struct file *file,
                 RETURN(-EPERM);
         }
 
+#ifdef HAVE_EXT4_LDISKFS
+        /* ext4_ioctl does not have a inode argument, so create a dummy file */
+        if (file == NULL) {
+                OBD_ALLOC_PTR(dummy_file.f_dentry);
+                if (dummy_file.f_dentry == NULL) {
+                        RETURN(-ENOMEM);
+                }
+
+                dummy_file.f_dentry->d_inode = inode;
+        }
+        if (inode->i_fop->unlocked_ioctl)
+                rc = inode->i_fop->unlocked_ioctl(file ?: &dummy_file, cmd,arg);
+
+        if (file == NULL)
+                OBD_FREE_PTR(dummy_file.f_dentry);
+#else
         if (inode->i_fop->ioctl)
                 rc = inode->i_fop->ioctl(inode, file, cmd, arg);
+#endif
         else
                 RETURN(-ENOTTY);
 
@@ -722,8 +763,8 @@ static int fsfilt_ext3_add_journal_cb(struct obd_device *obd, __u64 last_rcvd,
         fcb->cb_data = cb_data;
 
         CDEBUG(D_EXT2, "set callback for last_rcvd: "LPD64"\n", last_rcvd);
-        journal_callback_set(handle, fsfilt_ext3_cb_func,
-                             (struct journal_callback *)fcb);
+        fsfilt_journal_callback_set(handle, fsfilt_ext3_cb_func,
+                                    (struct journal_callback *)fcb);
 
         return 0;
 }
@@ -767,11 +808,16 @@ static int fsfilt_ext3_sync(struct super_block *sb)
 
 #ifdef EXT3_MULTIBLOCK_ALLOCATOR
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
-#define ext3_up_truncate_sem(inode)  up(&EXT3_I(inode)->truncate_sem);
-#define ext3_down_truncate_sem(inode)  down(&EXT3_I(inode)->truncate_sem);
+#define fsfilt_up_truncate_sem(inode)  up(&EXT3_I(inode)->truncate_sem);
+#define fsfilt_down_truncate_sem(inode)  down(&EXT3_I(inode)->truncate_sem);
+#else
+#ifdef HAVE_EXT4_LDISKFS
+#define fsfilt_up_truncate_sem(inode) up_write((&EXT4_I(inode)->i_data_sem));
+#define fsfilt_down_truncate_sem(inode) down_write((&EXT4_I(inode)->i_data_sem));
 #else
-#define ext3_up_truncate_sem(inode)  mutex_unlock(&EXT3_I(inode)->truncate_mutex);
-#define ext3_down_truncate_sem(inode)  mutex_lock(&EXT3_I(inode)->truncate_mutex);
+#define fsfilt_up_truncate_sem(inode)  mutex_unlock(&EXT3_I(inode)->truncate_mutex);
+#define fsfilt_down_truncate_sem(inode)  mutex_lock(&EXT3_I(inode)->truncate_mutex);
+#endif
 #endif
 
 #ifndef EXT_ASSERT
@@ -780,10 +826,14 @@ static int fsfilt_ext3_sync(struct super_block *sb)
 
 #ifdef EXT3_EXT_HAS_NO_TREE
 /* for kernels 2.6.18 and later */
+#ifdef HAVE_EXT4_LDISKFS
+#define EXT_GENERATION(inode)           (EXT4_I(inode)->i_ext_generation)
+#else
+#define EXT_GENERATION(inode)           ext_generation(inode)
+#endif
 #define ext3_ext_base                   inode
 #define ext3_ext_base2inode(inode)      (inode)
 #define EXT_DEPTH(inode)                ext_depth(inode)
-#define EXT_GENERATION(inode)           ext_generation(inode)
 #define fsfilt_ext3_ext_walk_space(inode, block, num, cb, cbdata) \
                         ext3_ext_walk_space(inode, block, num, cb, cbdata);
 #else
@@ -794,15 +844,6 @@ static int fsfilt_ext3_sync(struct super_block *sb)
 #endif
 
 #include <linux/lustre_version.h>
-#if EXT3_EXT_MAGIC == 0xf301
-#define ee_start e_start
-#define ee_block e_block
-#define ee_len   e_num
-#endif
-#ifndef EXT3_BB_MAX_BLOCKS
-#define ext3_mb_new_blocks(handle, inode, goal, count, aflags, err) \
-        ext3_new_blocks(handle, inode, count, goal, err)
-#endif
 
 struct bpointers {
         unsigned long *blocks;
@@ -836,7 +877,7 @@ static int ext3_ext_find_goal(struct inode *inode, struct ext3_ext_path *path,
                         if (ex->ee_block + ex->ee_len == block)
                                 *aflags |= 1;
 #endif
-                        return ex->ee_start + (block - ex->ee_block);
+                        return ext_pblock(ex) + (block - ex->ee_block);
                 }
 
                 /* it looks index is empty
@@ -962,15 +1003,14 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base,
 
         tgen = EXT_GENERATION(base);
         count = ext3_ext_calc_credits_for_insert(base, path);
-        ext3_up_truncate_sem(inode);
-
+        fsfilt_up_truncate_sem(inode);
         handle = ext3_journal_start(inode, count+EXT3_ALLOC_NEEDED+1);
         if (IS_ERR(handle)) {
-                ext3_down_truncate_sem(inode);
+                fsfilt_down_truncate_sem(inode);
                 return PTR_ERR(handle);
         }
 
-        ext3_down_truncate_sem(inode);
+        fsfilt_down_truncate_sem(inode);
         if (tgen != EXT_GENERATION(base)) {
                 /* the tree has changed. so path can be invalid at moment */
                 ext3_journal_stop(handle);
@@ -985,7 +1025,7 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base,
 
         /* insert new extent */
         nex.ee_block = cex->ec_block;
-        nex.ee_start = pblock;
+        ext3_ext_store_pblock(&nex, pblock);
         nex.ee_len = count;
         err = ext3_ext_insert_extent(handle, base, path, &nex);
         if (err) {
@@ -995,7 +1035,7 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base,
 #ifdef EXT3_MB_HINT_GROUP_ALLOC
                 ext3_mb_discard_inode_preallocations(inode);
 #endif
-                ext3_free_blocks(handle, inode, nex.ee_start, nex.ee_len, 0);
+                ext3_free_blocks(handle, inode, ext_pblock(&nex), nex.ee_len, 0);
                 goto out;
         }
 
@@ -1005,7 +1045,7 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base,
          * scaning after that block
          */
         cex->ec_len = nex.ee_len;
-        cex->ec_start = nex.ee_start;
+        cex->ec_start = ext_pblock(&nex);
         BUG_ON(nex.ee_len == 0);
         BUG_ON(nex.ee_block != cex->ec_block);
 
@@ -1018,9 +1058,10 @@ map:
                         CERROR("hmm. why do we find this extent?\n");
                         CERROR("initial space: %lu:%u\n",
                                 bp->start, bp->init_num);
-                        CERROR("current extent: %u/%u/%u %d\n",
+                        CERROR("current extent: %u/%u/%llu %d\n",
                                 cex->ec_block, cex->ec_len,
-                                cex->ec_start, cex->ec_type);
+                                (unsigned long long)cex->ec_start,
+                                cex->ec_type);
                 }
                 i = 0;
                 if (cex->ec_block < bp->start)
@@ -1074,10 +1115,10 @@ int fsfilt_map_nblocks(struct inode *inode, unsigned long block,
         bp.init_num = bp.num = num;
         bp.create = create;
 
-        ext3_down_truncate_sem(inode);
+        fsfilt_down_truncate_sem(inode);
         err = fsfilt_ext3_ext_walk_space(base, block, num, ext3_ext_new_extent_cb, &bp);
         ext3_ext_invalidate_cache(base);
-        ext3_up_truncate_sem(inode);
+        fsfilt_up_truncate_sem(inode);
 
         return err;
 }
@@ -1673,8 +1714,7 @@ read_inode_bitmap(struct super_block *sb, unsigned long group)
         struct buffer_head *bh;
 
         desc = get_group_desc(sb, group);
-        bh = sb_bread(sb, le32_to_cpu(desc->bg_inode_bitmap));
-
+        bh = sb_bread(sb, ext3_inode_bitmap(sb, desc));
         return bh;
 }
 
index 4b02b98..8eb23c3 100644 (file)
@@ -785,7 +785,7 @@ static int mds_getattr_internal(struct obd_device *obd, struct dentry *dentry,
 
                 /* We only return the full set of flags on ioctl, otherwise we
                  * get enough flags from the inode in mds_pack_inode2body(). */
-                rc = fsfilt_iocontrol(obd, inode, NULL, EXT3_IOC_GETFLAGS,
+                rc = fsfilt_iocontrol(obd, inode, NULL, FSFILT_IOC_GETFLAGS,
                                       (long)&flags);
                 if (rc == 0)
                         body->flags = flags | MDS_BFLAG_EXT_FLAGS;
index a095846..3809c8b 100644 (file)
@@ -771,7 +771,7 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset,
                 GOTO(cleanup, rc);
 
         if (rec->ur_iattr.ia_valid & ATTR_ATTR_FLAG) {  /* ioctl */
-                rc = fsfilt_iocontrol(obd, inode, NULL, EXT3_IOC_SETFLAGS,
+                rc = fsfilt_iocontrol(obd, inode, NULL, FSFILT_IOC_SETFLAGS,
                                       (long)&rec->ur_flags);
         } else if (rec->ur_iattr.ia_valid) {            /* setattr */
                 rc = fsfilt_setattr(obd, de, handle, &rec->ur_iattr, 0);
index 91d24a6..99b038c 100644 (file)
@@ -2822,7 +2822,7 @@ int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
 
         if (oa->o_valid & OBD_MD_FLFLAGS) {
                 rc = fsfilt_iocontrol(exp->exp_obd, inode, NULL,
-                                      EXT3_IOC_SETFLAGS, (long)&oa->o_flags);
+                                      FSFILT_IOC_SETFLAGS, (long)&oa->o_flags);
         } else {
                 rc = fsfilt_setattr(exp->exp_obd, dentry, handle, &iattr, 1);
                 if (fcc != NULL)
@@ -3806,8 +3806,9 @@ static int filter_get_info(struct obd_export *exp, __u32 keylen,
 
                 memcpy(fiemap, &fm_key->fiemap, sizeof(*fiemap));
                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+
                 rc = fsfilt_iocontrol(obd, dentry->d_inode, NULL,
-                                      EXT3_IOC_FIEMAP, (long)fiemap);
+                                      FSFILT_IOC_FIEMAP, (long)fiemap);
                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
                 f_dput(dentry);
index c7577fe..27eaf25 100644 (file)
@@ -2254,7 +2254,8 @@ test_52a() {
        link $DIR/d52a/foo $DIR/d52a/foo_link 2>/dev/null && error "link worked"
        echo foo >> $DIR/d52a/foo || error "append foo failed"
        mrename $DIR/d52a/foo $DIR/d52a/foo_ren && error "rename worked"
-       lsattr $DIR/d52a/foo | egrep -q "^-+a-+ $DIR/d52a/foo" || error "lsattr"
+       # new lsattr displays 'e' flag for extents
+       lsattr $DIR/d52a/foo | egrep -q "^-+a[-e]+ $DIR/d52a/foo" || error "lsattr"
        chattr -a $DIR/d52a/foo || error "chattr -a failed"
 
        rm -fr $DIR/d52a || error "cleanup rm failed"
@@ -2274,7 +2275,7 @@ test_52b() {
        mrename $DIR/d52b/foo $DIR/d52b/foo_ren && error
        [ -f $DIR/d52b/foo ] || error
        [ -f $DIR/d52b/foo_ren ] && error
-       lsattr $DIR/d52b/foo | egrep -q "^-+i-+ $DIR/d52b/foo" || error
+       lsattr $DIR/d52b/foo | egrep -q "^-+i[-e]+ $DIR/d52b/foo" || error
        chattr -i $DIR/d52b/foo || error
 
        rm -fr $DIR/d52b || error
@@ -2289,7 +2290,7 @@ test_52c() { # 12848 simulating client < 1.4.7
 #define OBD_FAIL_MDC_OLD_EXT_FLAGS       0x802
         lctl set_param fail_loc=0x802
         chattr =i $DIR/d52c/foo || error
-        lsattr $DIR/d52c/foo | egrep -q "^-+i-+ $DIR/d52c/foo" || error
+        lsattr $DIR/d52c/foo | egrep -q "^-+i[-e]+ $DIR/d52c/foo" || error
         chattr -i $DIR/d52c/foo || error
         lctl set_param -n fail_loc=0
 
index 5b874aa..9f17c0d 100644 (file)
@@ -505,7 +505,7 @@ static void enable_default_backfs_features(struct mkfs_opts *mop)
         int maj_high, maj_low, min;
         int ret;
 
-        strscat(mop->mo_mkfsopts, " -O dir_index", sizeof(mop->mo_mkfsopts));
+        strscat(mop->mo_mkfsopts, " -O dir_index,extents", sizeof(mop->mo_mkfsopts));
 
         /* Upstream e2fsprogs called our uninit_groups feature uninit_bg,
          * check for both of them when testing e2fsprogs features. */