vfs: return EINVAL instead of ENOENT when missing source
PATCH 1/1 vfs: return EINVAL instead of ENOENT when missing source
mount(2) with a NULL source device would return ENOENT instead of EINVAL after this commit:
commit f3a09c92018a91ad0981146a4ac59414f814d801
Author: Al Viro <[email protected]> Date: Sun Dec 23 18:55:56 2018 -0500
introduce fs_context methods
Change the return value to be compatible with the old behaviour.
This was caught by LTP mount02[1]. This testcase is calling mount(2) with a NULL device name and expecting EINVAL to PASS but now we are getting ENOENT.
[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mount/mount02.c
--- fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/super.c +1 -1
@@ -1469,7 +1469,7 @@ int vfs_get_tree(struct fs_context *fc)if (fc->fs_type->fs_flags &FS_REQUIRES_DEV && !fc->source) {errorf (fc,"Filesystem requires source device" ); -return -ENOENT ; +return -EINVAL ; }if (fc->root)
Signature · 1 line
2.21.0
Quoted 9 lines · Murphy Zhou
mount(2) with a NULL source device would return ENOENT instead of EINVAL after this commit:
commit
f3a09c92018a91ad0981146a4ac59414f814d801Author: Al Viro <[email protected]> Date: Sun Dec 23 18:55:56 2018 -0500introduce
fs_contextmethods
Quoted 8 lines
Change the return value to be compatible with the old behaviour.
This was caught by LTP mount02[1]. This testcase is calling mount(2) with a NULL device name and expecting EINVAL to PASS but now we are getting ENOENT.
[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mount/mount02.c
Signed-off-by Murphy Zhou <[email protected]>
Ping on this one?
Thanks!
Quoted 38 lines · Murphy Zhou
mount(2) with a NULL source device would return ENOENT instead of EINVAL after this commit:
commit
f3a09c92018a91ad0981146a4ac59414f814d801Author: Al Viro <[email protected]> Date: Sun Dec 23 18:55:56 2018 -0500introduce
fs_contextmethodsChange the return value to be compatible with the old behaviour.
This was caught by LTP mount02[1]. This testcase is calling mount(2) with a NULL device name and expecting EINVAL to PASS but now we are getting ENOENT.
[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mount/mount02.c
Signed-off-by Murphy Zhou <[email protected]>--- fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/super.c +1
-2@@ -1469,7 +1469,7 @@ int vfs_get_tree(struct fs_context *fc)if (fc->fs_type->fs_flags &FS_REQUIRES_DEV && !fc->source) {errorf (fc,"Filesystem requires source device" ); -return -ENOENT ; +return -EINVAL ; }if (fc->root) --2.21.0
Hi AL, what do you think, ;)
Quoted 38 lines · Murphy Zhou
mount(2) with a NULL source device would return ENOENT instead of EINVAL after this commit:
commit
f3a09c92018a91ad0981146a4ac59414f814d801Author: Al Viro <[email protected]> Date: Sun Dec 23 18:55:56 2018 -0500introduce
fs_contextmethodsChange the return value to be compatible with the old behaviour.
This was caught by LTP mount02[1]. This testcase is calling mount(2) with a NULL device name and expecting EINVAL to PASS but now we are getting ENOENT.
[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mount/mount02.c
Signed-off-by Murphy Zhou <[email protected]>--- fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/super.c +1
-2@@ -1469,7 +1469,7 @@ int vfs_get_tree(struct fs_context *fc)if (fc->fs_type->fs_flags &FS_REQUIRES_DEV && !fc->source) {errorf (fc,"Filesystem requires source device" ); -return -ENOENT ; +return -EINVAL ; }if (fc->root) --2.21.0