mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
udf: Skip parent dir link count update if corrupted
If the parent directory link count is too low (likely directory inode corruption), just skip updating its link count as if it goes to 0 too early it can cause unexpected issues. Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
ac6f420291
commit
c5566903af
@ -517,7 +517,11 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
inode->i_nlink);
|
||||
clear_nlink(inode);
|
||||
inode->i_size = 0;
|
||||
if (dir->i_nlink >= 3)
|
||||
inode_dec_link_count(dir);
|
||||
else
|
||||
udf_warn(inode->i_sb, "parent dir link count too low (%u)\n",
|
||||
dir->i_nlink);
|
||||
udf_add_fid_counter(dir->i_sb, true, -1);
|
||||
inode_set_mtime_to_ts(dir,
|
||||
inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode)));
|
||||
|
Loading…
Reference in New Issue
Block a user