diff --git a/module/os/linux/zfs/zfs_dir.c b/module/os/linux/zfs/zfs_dir.c index 564e89b37d11..e98f39fd2cfc 100644 --- a/module/os/linux/zfs/zfs_dir.c +++ b/module/os/linux/zfs/zfs_dir.c @@ -303,6 +303,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, mutex_exit(&dzp->z_lock); + int was_zxattr = flag & ZXATTR; + /* * We have a dirlock on the name. (Note that it is the dirlock, * not the dzp's z_lock, that protects the name in the zap object.) @@ -329,6 +331,9 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, } error = zfs_zget(zfsvfs, zoid, zpp); if (error) { + if (was_zxattr) + pr_err("zfs: was zxattr, zfs_dirent_lock: zfs_zget failed " + "with error %d\n", error); zfs_dirent_unlock(dl); return (error); } diff --git a/module/os/linux/zfs/zfs_znode_os.c b/module/os/linux/zfs/zfs_znode_os.c index f13edf95b5fe..a153d0850def 100644 --- a/module/os/linux/zfs/zfs_znode_os.c +++ b/module/os/linux/zfs/zfs_znode_os.c @@ -1089,7 +1089,12 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t **zpp) */ ASSERT3P(zp, !=, NULL); - VERIFY3P(igrab(ZTOI(zp)), !=, NULL); + if (igrab(ZTOI(zp)) == NULL) { + dump_stack(); + sa_buf_rele(db, NULL); + zfs_znode_hold_exit(zfsvfs, zh); + return (SET_ERROR(EIO)); + } *zpp = zp; sa_buf_rele(db, NULL); diff --git a/module/os/linux/zfs/zpl_super.c b/module/os/linux/zfs/zpl_super.c index 098f876e35c5..993d3773ef1c 100644 --- a/module/os/linux/zfs/zpl_super.c +++ b/module/os/linux/zfs/zpl_super.c @@ -382,20 +382,13 @@ static int zpl_drop_inode(struct inode *ip) { znode_t *zp = ITOZ(ip); - zfsvfs_t *zfsvfs = ZTOZSB(zp); dmu_buf_t *db; - znode_hold_t *zh; int error; - zh = zfs_znode_hold_enter(zfsvfs, zp->z_id); - if (!zp->z_unlinked && zp->z_sa_hdl && (db = sa_get_db(zp->z_sa_hdl)) && - dmu_buf_refcount(db)) { - zfs_znode_hold_exit(zfsvfs, zh); + dmu_buf_refcount(db)) return (0); - } - zfs_znode_hold_exit(zfsvfs, zh); error = generic_drop_inode(ip); return (error);