mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Fix incorrect inode link count check in case of rename.
The check was incorrect because the directory inode link count have min value 2 after dir_nlink extfs feature introduction.
This commit is contained in:
parent
ec81c9cc06
commit
86e2d48bf9
1 changed files with 2 additions and 1 deletions
|
|
@ -1018,10 +1018,11 @@ abortit:
|
|||
*/
|
||||
ext2_dec_nlink(xp);
|
||||
if (doingdirectory) {
|
||||
if (--xp->i_nlink != 0)
|
||||
if (xp->i_nlink > 2)
|
||||
panic("ext2_rename: linked directory");
|
||||
error = ext2_truncate(tvp, (off_t)0, IO_SYNC,
|
||||
tcnp->cn_cred, tcnp->cn_thread);
|
||||
xp->i_nlink = 0;
|
||||
}
|
||||
xp->i_flag |= IN_CHANGE;
|
||||
vput(tvp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue