diff mbox

[v2] ubifs: respect MS_SILENT mount flag

Message ID 1401265736.2118.2.camel@sauron.fi.intel.com
State Superseded
Headers show

Commit Message

Artem Bityutskiy May 28, 2014, 8:28 a.m. UTC
On Wed, 2014-05-28 at 11:14 +0300, Artem Bityutskiy wrote:
> On Wed, 2014-05-28 at 08:07 +0000, Bityutskiy, Artem wrote:
> > On Wed, 2014-05-28 at 11:01 +0300, Artem Bityutskiy wrote: 
> > > +       /*
> > > +        * Good commend describing what we are doing.
> > > +        */
> > > +       c->probing = 1
> > 
> > Err, actually:
> > 
> >           c->probing = silent;
> > 
> > >         err = ubifs_read_superblock(c);
> > > +       c->probing = 0
> > >         if (err)
> > >                 goto out_free;
> 
> I guess you guys got the idea, but just in case, you also will need to
> add "if (!c->probing) { ubifs_error() }" in the relevant places.

Or even introduce a new version of the error macro, something like
'ubifs_errc(), and use that in the relevant places. Not sure what is
going to look better, though. Here is a sketch:

Comments

hujianyang May 28, 2014, 8:42 a.m. UTC | #1
Hi Artem,

> 
> Or even introduce a new version of the error macro, something like
> 'ubifs_errc(), and use that in the relevant places. Not sure what is
> going to look better, though. Here is a sketch:
> 
> 
> diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
> index e8c8cfe..60cffa7 100644
> --- a/fs/ubifs/ubifs.h
> +++ b/fs/ubifs/ubifs.h
> @@ -52,6 +52,14 @@
>         pr_warn("UBIFS warning (pid %d): %s: " fmt "\n",            \
>                 current->pid, __func__, ##__VA_ARGS__)
>  
> +/*
> + * A variant of 'ubifs_err()' which takes the UBIFS file-sytem description
> + * object as an argument.
> + */
> +#define ubifs_errc(c, fmt, ...)                                    \
> +       if (!(c)->probing)                                          \
> +               ubifs_err(fmt, ##__VA_ARGS__)
> +
>  /* UBIFS file system VFS magic number */
>  #define UBIFS_SUPER_MAGIC 0x24051905
> 

I have to say I was just writing to you about adding a new marco to instead.
Ha~

In this way we can disable unnecessary messages during mount if we use "slient"
flag. I have a simple question,Is this @probing safe during mount? Are there
some probably race conditions of it? I have no experiences of these.

I think you should find out which ubifs_err should be replace into your
"ubifs_errc" in the next step.

Thank you very much!


Hu
Artem Bityutskiy May 28, 2014, 9:29 a.m. UTC | #2
On Wed, 2014-05-28 at 16:42 +0800, hujianyang wrote:
> In this way we can disable unnecessary messages during mount if we use "slient"
> flag. I have a simple question,Is this @probing safe during mount? Are there
> some probably race conditions of it? I have no experiences of these.

I do not think so, the mount path is "single-stream".
diff mbox

Patch

diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index e8c8cfe..60cffa7 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -52,6 +52,14 @@ 
        pr_warn("UBIFS warning (pid %d): %s: " fmt "\n",            \
                current->pid, __func__, ##__VA_ARGS__)
 
+/*
+ * A variant of 'ubifs_err()' which takes the UBIFS file-sytem description
+ * object as an argument.
+ */
+#define ubifs_errc(c, fmt, ...)                                    \
+       if (!(c)->probing)                                          \
+               ubifs_err(fmt, ##__VA_ARGS__)
+
 /* UBIFS file system VFS magic number */
 #define UBIFS_SUPER_MAGIC 0x24051905