lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu,  7 Mar 2024 09:20:09 +0000
From: Colin Ian King <colin.i.king@...il.com>
To: Wedson Almeida Filho <walmeida@...rosoft.com>,
	Christian Brauner <brauner@...nel.org>,
	linux-fsdevel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
	willy@...radead.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH][next][V2] hfsplus: remove dev_err messages and fix errno values

While exercising hfsplus with stress-ng with xattr tests the kernel
log was spammed with many error messages. The need to emit these
messages is not necessary, so remove them. Also fix the errno returns,
for XATTR_CREATE errors these should be -EEXIST, and for XATTR_REPLACE
this should be -ENODATA.

Kudos to Matthew Wilcox for spotting the need for -EEXIST instead of
-EOPNOTSUPP.

Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---

V2: Also remove "cannot replace xattr" message and fix the errno returns

---
 fs/hfsplus/xattr.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index 9c9ff6b8c6f7..f61a9370a233 100644
--- a/fs/hfsplus/xattr.c
+++ b/fs/hfsplus/xattr.c
@@ -288,8 +288,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
 
 	if (!strcmp_xattr_finder_info(name)) {
 		if (flags & XATTR_CREATE) {
-			pr_err("xattr exists yet\n");
-			err = -EOPNOTSUPP;
+			err = -EEXIST;
 			goto end_setxattr;
 		}
 		hfs_bnode_read(cat_fd.bnode, &entry, cat_fd.entryoffset,
@@ -335,8 +334,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
 
 	if (hfsplus_attr_exists(inode, name)) {
 		if (flags & XATTR_CREATE) {
-			pr_err("xattr exists yet\n");
-			err = -EOPNOTSUPP;
+			err = -EEXIST;
 			goto end_setxattr;
 		}
 		err = hfsplus_delete_attr(inode, name);
@@ -347,8 +345,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
 			goto end_setxattr;
 	} else {
 		if (flags & XATTR_REPLACE) {
-			pr_err("cannot replace xattr\n");
-			err = -EOPNOTSUPP;
+			err = -ENODATA;
 			goto end_setxattr;
 		}
 		err = hfsplus_create_attr(inode, name, value, size);
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ