Whamcloud - gitweb
LU-15535 llite: deadlock on lli_lsm_sem
[fs/lustre-release.git] / lustre / llite / dir.c
index 2a1393b..342c65f 100644 (file)
@@ -376,8 +376,7 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
                GOTO(out, rc = PTR_ERR(op_data));
 
        /* foreign dirs are browsed out of Lustre */
-       if (unlikely(op_data->op_mea1 != NULL &&
-                    op_data->op_mea1->lsm_md_magic == LMV_MAGIC_FOREIGN)) {
+       if (unlikely(lmv_dir_foreign(op_data->op_lso1))) {
                ll_finish_md_op_data(op_data);
                RETURN(-ENODATA);
        }
@@ -688,9 +687,9 @@ static int ll_dir_get_default_lmv(struct inode *inode, struct lmv_user_md *lum)
 
        ENTRY;
 retry:
-       if (lli->lli_default_lsm_md) {
+       if (lli->lli_def_lsm_obj) {
                down_read(&lli->lli_lsm_sem);
-               lsm = lli->lli_default_lsm_md;
+               lsm = &lli->lli_def_lsm_obj->lso_lsm;
                if (lsm) {
                        lum->lum_magic = lsm->lsm_md_magic;
                        lum->lum_stripe_count = lsm->lsm_md_stripe_count;
@@ -2015,7 +2014,7 @@ out_rmdir:
                         * instead of the client.
                         */
                        if (cmd == LL_IOC_MDC_GETINFO_V2 &&
-                           ll_i2info(inode)->lli_lsm_md != NULL)
+                           ll_dir_striped(inode))
                                valid &= ~(OBD_MD_FLSIZE | OBD_MD_FLBLOCKS);
 
                        if (flagsp && copy_to_user(flagsp, &valid,