aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/xattr.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-01-20 14:12:53 +0100
committerRichard Weinberger <richard@nod.at>2021-02-12 21:53:23 +0100
commitd984bcf5766dbdbe95d325bb8a1b49a996fecfd4 (patch)
tree555731f994e440d9d1af6ea4e5583b355b0c60a7 /fs/ubifs/xattr.c
parentubifs: replay: Fix high stack usage, again (diff)
downloadlinux-dev-d984bcf5766dbdbe95d325bb8a1b49a996fecfd4.tar.xz
linux-dev-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/xattr.c')
-rw-r--r--fs/ubifs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index a0b9b349efe6..842d5f14545d 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -498,7 +498,7 @@ int ubifs_purge_xattrs(struct inode *host)
struct fscrypt_name nm = {0};
int err;
- if (ubifs_inode(host)->xattr_cnt < ubifs_xattr_max_cnt(c))
+ if (ubifs_inode(host)->xattr_cnt <= ubifs_xattr_max_cnt(c))
return 0;
ubifs_warn(c, "inode %lu has too many xattrs, doing a non-atomic deletion",