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
@ -1018,10 +1018,11 @@ abortit:
|
|||||||
*/
|
*/
|
||||||
ext2_dec_nlink(xp);
|
ext2_dec_nlink(xp);
|
||||||
if (doingdirectory) {
|
if (doingdirectory) {
|
||||||
if (--xp->i_nlink != 0)
|
if (xp->i_nlink > 2)
|
||||||
panic("ext2_rename: linked directory");
|
panic("ext2_rename: linked directory");
|
||||||
error = ext2_truncate(tvp, (off_t)0, IO_SYNC,
|
error = ext2_truncate(tvp, (off_t)0, IO_SYNC,
|
||||||
tcnp->cn_cred, tcnp->cn_thread);
|
tcnp->cn_cred, tcnp->cn_thread);
|
||||||
|
xp->i_nlink = 0;
|
||||||
}
|
}
|
||||||
xp->i_flag |= IN_CHANGE;
|
xp->i_flag |= IN_CHANGE;
|
||||||
vput(tvp);
|
vput(tvp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user