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
This commit is contained in:
Konstantin Belousov 2025-07-27 16:47:22 +03:00
parent 9a6ba186e0
commit c069ca085b

View file

@ -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;