Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
snajpa committed Oct 10, 2024
1 parent e4e00df commit df89a27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions module/os/linux/zfs/zfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand All @@ -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);
}
Expand Down
7 changes: 6 additions & 1 deletion module/os/linux/zfs/zfs_znode_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 1 addition & 8 deletions module/os/linux/zfs/zpl_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df89a27

Please sign in to comment.