mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
ubifs: ubifs_jnl_write_inode: Only check once for the limitation of xattr count
No need to check the limitation of xattr count every time in function ubifs_jnl_write_inode(), because the 'ui->xattr_cnt' won't be modified by others in the inode evicting process. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
2d5404caa8
commit
957e1c4e17
1 changed files with 6 additions and 6 deletions
|
@ -981,6 +981,12 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
|
||||||
|
|
||||||
dbg_jnl("ino %lu, nlink %u", inode->i_ino, inode->i_nlink);
|
dbg_jnl("ino %lu, nlink %u", inode->i_ino, inode->i_nlink);
|
||||||
|
|
||||||
|
if (kill_xattrs && ui->xattr_cnt > ubifs_xattr_max_cnt(c)) {
|
||||||
|
ubifs_err(c, "Cannot delete inode, it has too much xattrs!");
|
||||||
|
ubifs_ro_mode(c, err);
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the inode is being deleted, do not write the attached data. No
|
* If the inode is being deleted, do not write the attached data. No
|
||||||
* need to synchronize the write-buffer either.
|
* need to synchronize the write-buffer either.
|
||||||
|
@ -1012,12 +1018,6 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
|
||||||
struct inode *xino;
|
struct inode *xino;
|
||||||
struct ubifs_dent_node *xent, *pxent = NULL;
|
struct ubifs_dent_node *xent, *pxent = NULL;
|
||||||
|
|
||||||
if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)) {
|
|
||||||
err = -EPERM;
|
|
||||||
ubifs_err(c, "Cannot delete inode, it has too much xattrs!");
|
|
||||||
goto out_release;
|
|
||||||
}
|
|
||||||
|
|
||||||
lowest_xent_key(c, &key, inode->i_ino);
|
lowest_xent_key(c, &key, inode->i_ino);
|
||||||
while (1) {
|
while (1) {
|
||||||
xent = ubifs_tnc_next_ent(c, &key, &nm);
|
xent = ubifs_tnc_next_ent(c, &key, &nm);
|
||||||
|
|
Loading…
Add table
Reference in a new issue