git: 45401a4bdec4 - stable/15 - VOP_RENAME(9): add flags argument
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Mar 2026 11:43:36 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=45401a4bdec4a1c2d6bf7bc9deaaf858da7e41e4
commit 45401a4bdec4a1c2d6bf7bc9deaaf858da7e41e4
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-26 18:22:48 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-03-10 11:41:31 +0000
VOP_RENAME(9): add flags argument
(cherry picked from commit e486066cf48a89ba87fab6b3d2b56f271f50439b)
---
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 3 +++
sys/fs/fuse/fuse_vnops.c | 4 ++++
sys/fs/msdosfs/msdosfs_vnops.c | 5 +++++
sys/fs/nfsclient/nfs_clvnops.c | 6 ++++++
sys/fs/nfsserver/nfs_nfsdport.c | 2 +-
sys/fs/nullfs/null_vnops.c | 3 ++-
sys/fs/p9fs/p9fs_vnops.c | 5 +++++
sys/fs/smbfs/smbfs_vnops.c | 5 +++++
sys/fs/tmpfs/tmpfs_vnops.c | 5 +++++
sys/fs/unionfs/union_vnops.c | 7 ++++++-
sys/kern/vfs_syscalls.c | 2 +-
sys/kern/vnode_if.src | 1 +
sys/ufs/ufs/ufs_vnops.c | 7 +++++++
13 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
index 7ea6f119130b..ed4aa19b96e5 100644
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -5518,6 +5518,9 @@ zfs_freebsd_rename(struct vop_rename_args *ap)
}
#endif
+ if (error == 0 && ap->a_flags != 0)
+ error = EOPNOTSUPP;
+
if (error == 0) {
error = zfs_do_rename(fdvp, &fvp, ap->a_fcnp, tdvp, &tvp,
ap->a_tcnp, ap->a_fcnp->cn_cred);
diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c
index 9c0fa0a5b6f9..3bfc5396c365 100644
--- a/sys/fs/fuse/fuse_vnops.c
+++ b/sys/fs/fuse/fuse_vnops.c
@@ -2171,6 +2171,10 @@ fuse_vnop_rename(struct vop_rename_args *ap)
err = EXTERROR(EXDEV, "Cross-device rename");
goto out;
}
+ if (ap->a_flags != 0) {
+ err = EOPNOTSUPP;
+ goto out;
+ }
cache_purge(fvp);
/*
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 6dfac1b4ebd2..3e28a7ce9d05 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -970,6 +970,11 @@ msdosfs_rename(struct vop_rename_args *ap)
goto abortit;
}
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto abortit;
+ }
+
/*
* If source and dest are the same, do nothing.
*/
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 0d54b869d74c..5eea16d0f129 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -2196,6 +2196,12 @@ nfs_rename(struct vop_rename_args *ap)
error = EXDEV;
goto out;
}
+
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto out;
+ }
+
nmp = VFSTONFS(fvp->v_mount);
if (fvp == tvp) {
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 567de6422b7c..63f7b5ecf564 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -1715,7 +1715,7 @@ out:
if (error == 0) {
error = VOP_RENAME(fromndp->ni_dvp, fromndp->ni_vp,
&fromndp->ni_cnd, tondp->ni_dvp, tondp->ni_vp,
- &tondp->ni_cnd);
+ &tondp->ni_cnd, 0);
lockmgr(&mp->mnt_renamelock, LK_RELEASE, 0);
vfs_rel(mp);
} else {
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index acbe4cb03f76..a3daa2d8dd54 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -737,7 +737,8 @@ null_rename(struct vop_rename_args *ap)
ltvp = NULL;
}
- error = VOP_RENAME(lfdvp, lfvp, ap->a_fcnp, ltdvp, ltvp, ap->a_tcnp);
+ error = VOP_RENAME(lfdvp, lfvp, ap->a_fcnp, ltdvp, ltvp, ap->a_tcnp,
+ ap->a_flags);
vrele(fdvp);
vrele(fvp);
vrele(tdvp);
diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c
index acb73973d93b..ad1eb50276e3 100644
--- a/sys/fs/p9fs/p9fs_vnops.c
+++ b/sys/fs/p9fs/p9fs_vnops.c
@@ -2084,6 +2084,11 @@ p9fs_rename(struct vop_rename_args *ap)
goto out;
}
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto out;
+ }
+
/* warning if you are renaming to the same name */
if (fvp == tvp)
error = 0;
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c
index 63b249c93771..690f30681332 100644
--- a/sys/fs/smbfs/smbfs_vnops.c
+++ b/sys/fs/smbfs/smbfs_vnops.c
@@ -577,6 +577,11 @@ smbfs_rename(struct vop_rename_args *ap)
goto out;
}
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto out;
+ }
+
if (tvp && vrefcnt(tvp) > 1) {
error = EBUSY;
goto out;
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index e1bc0d156baa..5596f8794546 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -993,6 +993,11 @@ tmpfs_rename(struct vop_rename_args *v)
goto out;
}
+ if (v->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto out;
+ }
+
/* If source and target are the same file, there is nothing to do. */
if (fvp == tvp) {
error = 0;
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 602d5fdfcb97..9dccecaef5f7 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -1413,6 +1413,11 @@ unionfs_rename(struct vop_rename_args *ap)
goto unionfs_rename_abort;
}
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ goto unionfs_rename_abort;
+ }
+
/* Renaming a file to itself has no effect. */
if (fvp == tvp)
goto unionfs_rename_abort;
@@ -1581,7 +1586,7 @@ unionfs_rename(struct vop_rename_args *ap)
if (rfvp == rtvp)
goto unionfs_rename_abort;
- error = VOP_RENAME(rfdvp, rfvp, fcnp, rtdvp, rtvp, tcnp);
+ error = VOP_RENAME(rfdvp, rfvp, fcnp, rtdvp, rtvp, tcnp, ap->a_flags);
if (error == 0) {
if (rtvp != NULLVP && rtvp->v_type == VDIR)
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 5eaa9d0ef120..0af4e9d08253 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3887,7 +3887,7 @@ again1:
out:
if (error == 0) {
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
- tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
+ tond.ni_dvp, tond.ni_vp, &tond.ni_cnd, 0);
NDFREE_PNBUF(&fromnd);
NDFREE_PNBUF(&tond);
} else {
diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
index 3faefb607f24..6b7448d9f1df 100644
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -336,6 +336,7 @@ vop_rename {
IN WILLRELE struct vnode *tdvp;
IN WILLRELE struct vnode *tvp;
IN struct componentname *tcnp;
+ IN u_int flags;
};
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 736c5a66267e..429e6b5c8dd7 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1255,6 +1255,7 @@ ufs_rename(
struct vnode *a_tdvp;
struct vnode *a_tvp;
struct componentname *a_tcnp;
+ u_int a_flags;
} */ *ap)
{
struct vnode *tvp = ap->a_tvp;
@@ -1293,6 +1294,12 @@ ufs_rename(
goto releout;
}
+ if (ap->a_flags != 0) {
+ error = EOPNOTSUPP;
+ mp = NULL;
+ goto releout;
+ }
+
fdvp_s = fvp_s = tdvp_s = tvp_s = SEQC_MOD;
relock:
/*