diff options
author | pjd <pjd@FreeBSD.org> | 2007-05-22 21:22:25 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-05-22 21:22:25 +0000 |
commit | 4a15a486c9ba78eae859516edd5e51d2c9804308 (patch) | |
tree | 1054100308a52c496c1572427a8fde37a6607d66 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c | |
parent | fbc9e8162048bbbe3391a0c64d99f912ba57e396 (diff) | |
download | FreeBSD-src-4a15a486c9ba78eae859516edd5e51d2c9804308.zip FreeBSD-src-4a15a486c9ba78eae859516edd5e51d2c9804308.tar.gz |
Lock vnode on lookup. This fixes ZIL replay for rmdir/unlink/rename.
Reported by: des
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c index ad3ad91..d1ac49d 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c @@ -158,6 +158,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap) cn.cn_namelen = strlen(name); cn.cn_nameiop = DELETE; cn.cn_flags = ISLASTCN | SAVENAME; + cn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; cn.cn_cred = kcred; cn.cn_thread = curthread; vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY, curthread); @@ -249,6 +250,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) scn.cn_namelen = strlen(sname); scn.cn_nameiop = DELETE; scn.cn_flags = ISLASTCN | SAVENAME; + scn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; scn.cn_cred = kcred; scn.cn_thread = td; vn_lock(ZTOV(sdzp), LK_EXCLUSIVE | LK_RETRY, td); @@ -262,6 +264,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) tcn.cn_namelen = strlen(tname); tcn.cn_nameiop = RENAME; tcn.cn_flags = ISLASTCN | SAVENAME; + tcn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; tcn.cn_cred = kcred; tcn.cn_thread = td; vn_lock(ZTOV(tdzp), LK_EXCLUSIVE | LK_RETRY, td); |