diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-01-20 14:12:53 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2021-02-12 21:53:23 +0100 |
commit | d984bcf5766dbdbe95d325bb8a1b49a996fecfd4 (patch) | |
tree | 555731f994e440d9d1af6ea4e5583b355b0c60a7 /fs/ubifs/journal.c | |
parent | 410b6de702ef84fea6e7abcb6620ef8bfc112fae (diff) | |
download | linux-d984bcf5766dbdbe95d325bb8a1b49a996fecfd4.tar.gz linux-d984bcf5766dbdbe95d325bb8a1b49a996fecfd4.tar.bz2 linux-d984bcf5766dbdbe95d325bb8a1b49a996fecfd4.zip |
ubifs: Fix off-by-one error
An inode is allowed to have ubifs_xattr_max_cnt() xattrs, so we must
complain only when an inode has more xattrs, having exactly
ubifs_xattr_max_cnt() xattrs is fine.
With this the maximum number of xattrs can be created without hitting
the "has too many xattrs" warning when removing it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/journal.c')
-rw-r--r-- | fs/ubifs/journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 03410ae0813a..2857e64d673d 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -881,7 +881,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode) struct inode *xino; struct ubifs_dent_node *xent, *pxent = NULL; - if (ui->xattr_cnt >= ubifs_xattr_max_cnt(c)) { + if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)) { ubifs_err(c, "Cannot delete inode, it has too much xattrs!"); goto out_release; } |