fs/fuse kio_pcs: remove s_subtype check

Submitted by Pavel Butsykin on May 28, 2018, 3:28 p.m.

Details

Message ID 20180528152822.19953-1-pbutsykin@virtuozzo.com
State New
Series "fs/fuse kio_pcs: remove s_subtype check"
Headers show

Commit Message

Pavel Butsykin May 28, 2018, 3:28 p.m.
The s_subtype field is initialized after calling vfs_kern_mount(), so we can't
check s_subtype inside vfs_kern_mount(). Instead of s_subtype we can check
dev_name, but this leads to an unjustified modification of common fuse.

Given that s_subtype/dev_name check doesn't protect from the possibility to
mount fuse whith kpcs on any device except vstorage/pstorage, we can remove
this check.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 61378f0d9a58..930ddff1b680 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -142,12 +142,7 @@  void kpcs_conn_abort(struct fuse_conn *fc)
 
 static int kpcs_probe(struct fuse_conn *fc, char *name)
 {
-	if (IS_PSTORAGE(fc->sb))
-		return 1;
-
-	pr_err("FUSE: kio_pcs: kdirect is only available for"
-	       "pstorage/vstorage fuse mount\n");
-	return 0;
+	return 1;
 }
 
 static int fuse_pcs_getfileinfo(struct fuse_conn *fc, struct file *file,

Comments

Kirill Tkhai May 28, 2018, 3:31 p.m.
On 28.05.2018 18:28, Pavel Butsykin wrote:
> The s_subtype field is initialized after calling vfs_kern_mount(), so we can't
> check s_subtype inside vfs_kern_mount(). Instead of s_subtype we can check
> dev_name, but this leads to an unjustified modification of common fuse.
> 
> Given that s_subtype/dev_name check doesn't protect from the possibility to
> mount fuse whith kpcs on any device except vstorage/pstorage, we can remove
> this check.
> 
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> index 61378f0d9a58..930ddff1b680 100644
> --- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> +++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> @@ -142,12 +142,7 @@ void kpcs_conn_abort(struct fuse_conn *fc)
>  
>  static int kpcs_probe(struct fuse_conn *fc, char *name)
>  {
> -	if (IS_PSTORAGE(fc->sb))
> -		return 1;
> -
> -	pr_err("FUSE: kio_pcs: kdirect is only available for"
> -	       "pstorage/vstorage fuse mount\n");
> -	return 0;
> +	return 1;
>  }
>  
>  static int fuse_pcs_getfileinfo(struct fuse_conn *fc, struct file *file,
>