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>] [day] [month] [year] [list]
Date:   Sat, 15 Jul 2023 15:02:17 +0900
From:   Leesoo Ahn <lsahn@...eel.net>
To:     lsahn@...akecorp.com
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fs: inode: return proper errno on bmap()

It better returns -EOPNOTSUPP instead of -EINVAL which has meaning of
the argument is an inappropriate value. It doesn't make sense in the
case of that a file system doesn't support bmap operation.

-EINVAL could make confusion in the userspace perspective.

Signed-off-by: Leesoo Ahn <lsahn@...akecorp.com>
---
 fs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/inode.c b/fs/inode.c
index 8fefb69e1f84..c13cac26f08d 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1837,7 +1837,7 @@ EXPORT_SYMBOL(iput);
 int bmap(struct inode *inode, sector_t *block)
 {
 	if (!inode->i_mapping->a_ops->bmap)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	*block = inode->i_mapping->a_ops->bmap(inode->i_mapping, *block);
 	return 0;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ