aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-07-27 13:47:22 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-07-28 20:57:14 +0000
commitc069ca085bd185eda4a90dc4bc2b76cceb74579d (patch)
treecb17451c2290a0a6d26151444903824814d3aaa5
parent9a6ba186e0ca4269021d8843dbc8409ea78da4a6 (diff)
ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename()
Otherwise it is sign-extended into 64bit ino_t on the call to ufs_dirrewrite(). This causes invalid inode number recorded in the SU tracking structures (newdirem) and triggers corresponding panics. Reviewed by: mckusick, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51573
-rw-r--r--sys/ufs/ufs/ufs_vnops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 17308706c3f4..406b8f943077 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1268,7 +1268,8 @@ ufs_rename(
struct inode *fip, *tip, *tdp, *fdp;
struct direct newdir;
off_t endoff;
- int doingdirectory, newparent;
+ int doingdirectory;
+ u_int newparent;
int error = 0;
struct mount *mp;
ino_t ino;