From 5369eb85cac146ad1ef22a21b6676c7496e5c080 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 2 Mar 1999 05:31:47 +0000 Subject: Merge patch to ufs_vnops.c's ufs_rename to the copy of ufs_rename that lives in ext2_vnops.c for ext2fs. Also remove cast from comparision. Bruce pointed out that it was bogus since we'd force a signed comparision when we really wanted an unsigned comparison. --- sys/gnu/fs/ext2fs/ext2_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/gnu/fs') diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 8463a3008b880..006687b8d79a7 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -482,6 +482,11 @@ abortit: goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); + if (ip->i_nlink >= LINK_MAX) { + VOP_UNLOCK(fvp, 0, p); + error = EMLINK; + goto abortit; + } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { VOP_UNLOCK(fvp, 0, p); -- cgit v1.3