Skip to content

Commit

Permalink
ubifs: journal: Fix error return code in ubifs_jnl_write_inode()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: 9ca2d73 ("ubifs: Limit number of xattrs per inode")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Zhen Lei authored and richardweinberger committed Jun 18, 2021
1 parent 009c9aa commit a2c2a62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ubifs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
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;
}
Expand Down

0 comments on commit a2c2a62

Please sign in to comment.