mirror of
https://gitee.com/openharmony/kernel_linux
synced 2025-05-16 11:46:34 +00:00
ext2: make sure that partially set up inodes won't be returned by ext2_iget()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
5c1a68a358
commit
2e5afe54e0
@ -611,8 +611,7 @@ fail_drop:
|
|||||||
dquot_drop(inode);
|
dquot_drop(inode);
|
||||||
inode->i_flags |= S_NOQUOTA;
|
inode->i_flags |= S_NOQUOTA;
|
||||||
clear_nlink(inode);
|
clear_nlink(inode);
|
||||||
unlock_new_inode(inode);
|
discard_new_inode(inode);
|
||||||
iput(inode);
|
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@ -45,8 +45,7 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
inode_dec_link_count(inode);
|
inode_dec_link_count(inode);
|
||||||
unlock_new_inode(inode);
|
discard_new_inode(inode);
|
||||||
iput(inode);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,8 +191,7 @@ out:
|
|||||||
|
|
||||||
out_fail:
|
out_fail:
|
||||||
inode_dec_link_count(inode);
|
inode_dec_link_count(inode);
|
||||||
unlock_new_inode(inode);
|
discard_new_inode(inode);
|
||||||
iput (inode);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,8 +259,7 @@ out:
|
|||||||
out_fail:
|
out_fail:
|
||||||
inode_dec_link_count(inode);
|
inode_dec_link_count(inode);
|
||||||
inode_dec_link_count(inode);
|
inode_dec_link_count(inode);
|
||||||
unlock_new_inode(inode);
|
discard_new_inode(inode);
|
||||||
iput(inode);
|
|
||||||
out_dir:
|
out_dir:
|
||||||
inode_dec_link_count(dir);
|
inode_dec_link_count(dir);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user