* [PATCH] fs: inode: return proper errno on bmap()
@ 2023-07-15 6:02 Leesoo Ahn
[not found] ` <fa1386fb-04af-8037-2591-781f8723d564@web.de>
0 siblings, 1 reply; 2+ messages in thread
From: Leesoo Ahn @ 2023-07-15 6:02 UTC (permalink / raw)
To: lsahn; +Cc: Alexander Viro, Christian Brauner, linux-fsdevel, linux-kernel
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@wewakecorp.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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fs: inode: return proper errno on bmap()
[not found] ` <fa1386fb-04af-8037-2591-781f8723d564@web.de>
@ 2023-07-15 6:49 ` Leesoo Ahn
0 siblings, 0 replies; 2+ messages in thread
From: Leesoo Ahn @ 2023-07-15 6:49 UTC (permalink / raw)
To: Markus Elfring
Cc: LKML, linux-fsdevel, kernel-janitors, Alexander Viro, Christian Brauner
2023-07-15 오후 3:39에 Markus Elfring 이(가) 쓴 글:
> > 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.
>
> Are imperative change descriptions still preferred?
>
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.5-rc1#n94
>
>
> How do you think about to use a subject like “[PATCH v2] fs: inode:
> Return proper error code in bmap()”?
>
>
> Please reconsider also the distribution of addresses in recipient lists.
> https://lore.kernel.org/lkml/20230715060217.1469690-1-lsahn@wewakecorp.com/
>
> Regards,
> Markus
Thank you for the feedback.
I will post v2 patch soon
best regards,
Leesoo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-15 6:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-15 6:02 [PATCH] fs: inode: return proper errno on bmap() Leesoo Ahn
[not found] ` <fa1386fb-04af-8037-2591-781f8723d564@web.de>
2023-07-15 6:49 ` Leesoo Ahn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®