Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1652698

Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs: allow userspace to map mounts to volumes)

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs: allow userspace to map mounts to volumes)
Date 2017-05-29 21:40 +0200
Message-ID <tMyGe-4w8-11@gated-at.bofh.it> (permalink)
References <tMnhL-4ZZ-9@gated-at.bofh.it> <tMrv4-7MV-29@gated-at.bofh.it> <tMrEJ-865-21@gated-at.bofh.it> <tMtZU-1bi-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Rabin,

Am 29.05.2017 um 16:33 schrieb Rabin Vincent:
> On Mon, May 29, 2017 at 01:08:25PM +0100, Al Viro wrote:
>> Userspace sure as hell does.  st_dev in stat(2) is a block device number;
>> moreover, there might _be_ a block device with the same number at the same
>> time - even mounted.  Why not make ->show_options() print the currently
>> valid volume name, anyway?  That would seem to be the obvious approach...
> 
> The following patch works for me, if it's OK to show options that can't
> actually be used when mounting:

Good that this very small changes fulfils your use case. :-)
I'd accept and ignore ubi= and vol= parameters.

i.e.
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index cf4cc99b75b5..50cebbe35c38 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -931,6 +933,7 @@ enum {
 	Opt_chk_data_crc,
 	Opt_no_chk_data_crc,
 	Opt_override_compr,
+	Opt_ignore,
 	Opt_err,
 };

@@ -942,6 +945,8 @@ static const match_table_t tokens = {
 	{Opt_chk_data_crc, "chk_data_crc"},
 	{Opt_no_chk_data_crc, "no_chk_data_crc"},
 	{Opt_override_compr, "compr=%s"},
+	{Opt_ignore, "ubi=%s"},
+	{Opt_ignore, "vol=%s"},
 	{Opt_err, NULL},
 };

@@ -1042,6 +1047,8 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
 			c->default_compr = c->mount_opts.compr_type;
 			break;
 		}
+		case Opt_ignore:
+			break;
 		default:
 		{
 			unsigned long flag;

Thanks,
//richard

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] ubifs: allow userspace to map mounts to volumes Rabin Vincent <rabin.vincent@axis.com> - 2017-05-29 09:30 +0200
  Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs: allow  userspace to map mounts to volumes) Richard Weinberger <richard@nod.at> - 2017-05-29 14:00 +0200
    Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs:  allow userspace to map mounts to volumes) Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-29 14:10 +0200
      Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs:  allow userspace to map mounts to volumes) Rabin Vincent <rabin.vincent@axis.com> - 2017-05-29 16:40 +0200
        Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs:  allow userspace to map mounts to volumes) Richard Weinberger <richard@nod.at> - 2017-05-29 21:40 +0200

csiph-web