ubifs: Fix off-by-one error
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 20 Jan 2021 13:12:53 +0000 (14:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:51 +0000 (16:05 +0200)
commit6bcc0590cb919bb0c37b554afdaa929528f7bebc
tree1b546aaee88fa5ca77526904aaee06948b8bfd87
parentaab881d7f074e302451cfa3d85d30ba6b1cf3e13
ubifs: Fix off-by-one error

[ Upstream commit d984bcf5766dbdbe95d325bb8a1b49a996fecfd4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ubifs/journal.c
fs/ubifs/xattr.c