linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "hujianyang@huawei.com" <hujianyang@huawei.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>
Subject: Re: [PATCH v2] ubifs: respect MS_SILENT mount flag
Date: Wed, 28 May 2014 11:28:56 +0300	[thread overview]
Message-ID: <1401265736.2118.2.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1401264889.983.19.camel@sauron.fi.intel.com>

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:


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




-- 
Best Regards,
Artem Bityutskiy

  reply	other threads:[~2014-05-28  8:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17  1:55 [PATCH] ubifs: respect MS_SILENT mount flag Daniel Golle
2014-05-27 12:18 ` Artem Bityutskiy
2014-05-27 14:11   ` [PATCH v2] " Daniel Golle
2014-05-27 14:56     ` Artem Bityutskiy
2014-05-27 16:04       ` Daniel
2014-05-28  2:11         ` hujianyang
2014-05-28  8:01           ` Artem Bityutskiy
2014-05-28  8:07             ` Bityutskiy, Artem
2014-05-28  8:14               ` Artem Bityutskiy
2014-05-28  8:28                 ` Artem Bityutskiy [this message]
2014-05-28  8:42                   ` hujianyang
2014-05-28  9:29                     ` Artem Bityutskiy
2014-05-30 22:01                 ` [PATCH v3] " Daniel Golle
2014-05-30 23:20                   ` Brian Norris
2014-05-30 23:32                     ` [PATCH v4] " Daniel Golle
2014-05-31  0:01                     ` [PATCH v5] " Daniel Golle
2014-06-02  7:59                       ` Artem Bityutskiy
2014-06-02 13:51                         ` [PATCH v6] " Daniel Golle
2014-06-02 15:01                           ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401265736.2118.2.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=hujianyang@huawei.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).