X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_compat.c;h=0779f25cd6816a89de09062d7db4533352c53de2;hp=0c44850b697845654047a0db7d34f855561108eb;hb=af46e574eeebe23c5a6146a134fa00ee91931de3;hpb=140b897187cdbbdbc593b85dbb8a3322a9c28c9c diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index 0c44850..0779f25 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -27,7 +27,7 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2014, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -563,6 +563,13 @@ static int osd_obj_update_entry(struct osd_thread_info *info, GOTO(out, rc); } + /* The EA inode should NOT be in OI, old OI scrub may added + * such OI mapping by wrong, replace it. */ + if (unlikely(osd_is_ea_inode(inode))) { + iput(inode); + goto update; + } + rc = osd_get_lma(info, inode, dentry, lma); if (rc == -ENODATA) { rc = osd_get_idif(info, inode, dentry, oi_fid); @@ -586,7 +593,7 @@ static int osd_obj_update_entry(struct osd_thread_info *info, GOTO(out, rc = -EEXIST); } - if (fid_is_idif(fid) && fid_is_idif(oi_fid)) { + if (fid_is_idif(fid) && oi_fid != NULL && fid_is_idif(oi_fid)) { __u32 idx1 = fid_idif_ost_idx(fid); __u32 idx2 = fid_idif_ost_idx(oi_fid); struct ost_id *ostid = &info->oti_ostid; @@ -705,10 +712,11 @@ static int osd_obj_add_entry(struct osd_thread_info *info, inode = info->oti_inode; if (unlikely(inode == NULL)) { - OBD_ALLOC_PTR(inode); - if (inode == NULL) + struct ldiskfs_inode_info *lii; + OBD_ALLOC_PTR(lii); + if (lii == NULL) RETURN(-ENOMEM); - info->oti_inode = inode; + inode = info->oti_inode = &lii->vfs_inode; } inode->i_sb = osd_sb(osd);