Skip to content

Commit

Permalink
Skip ctldir znode in zfs_rezget to fix snapdir issues
Browse files Browse the repository at this point in the history
Skip ctldir in zfs_rezget, otherwise they will always get invalidated. This
will cause funny behaviour for the mounted snapdirs. Especially for
Linux >= 3.18, d_invalidate will detach the mountpoint and prevent anyone
automount it again as long as someone is still using the detached mount.

Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4514
Closes openzfs#4661
Closes openzfs#4672
  • Loading branch information
Chunwei Chen authored and nedbass committed Sep 2, 2016
1 parent de54359 commit f2ed4b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,16 @@ zfs_rezget(znode_t *zp)
uint64_t gen;
znode_hold_t *zh;

/*
* skip ctldir, otherwise they will always get invalidated. This will
* cause funny behaviour for the mounted snapdirs. Especially for
* Linux >= 3.18, d_invalidate will detach the mountpoint and prevent
* anyone automount it again as long as someone is still using the
* detached mount.
*/
if (zp->z_is_ctldir)
return (0);

zh = zfs_znode_hold_enter(zsb, obj_num);

mutex_enter(&zp->z_acl_lock);
Expand Down

0 comments on commit f2ed4b9

Please sign in to comment.