From: Artem Bityutskiy <dedekind1@gmail.com>
To: hujianyang <hujianyang@huawei.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
Daniel <daniel@makrotopia.org>
Subject: Re: [PATCH v2] ubifs: respect MS_SILENT mount flag
Date: Wed, 28 May 2014 11:01:44 +0300 [thread overview]
Message-ID: <1401264104.983.12.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <538545B4.7070103@huawei.com>
On Wed, 2014-05-28 at 10:11 +0800, hujianyang wrote:
> Hi Daniel and Artem,
>
> >
> > You can test this by trying to mount a non-empty volume which does not contain a
> > UBIFS superblock (but e.g. squashfs or a U-Boot environment) with
> > mount -t ubifs -o silent /dev/ubiX_Y /mnt
> > This should fail without creating any klog lines.
> >
>
> I think disabling log message in this case is needed. But I'm sorry to say
> I don't like just adding a new parameter to ubifs_read_node in this way
> because this silent flag seems only used during mount. This adding makes the
> parameters different in ubifs_read_node and ubifs_write_node, also not good
> for reading code.
So you bring up 2 points.
1. This patch only makes the read part of the mount code-path silent,
everything else stays normal.
2. Another parameter makes code less readable.
WRT the former, do we really need more than that? IIUC, this is exactly
the meaning of the 'silent' flag, and exactly its purpose. IIUC, it
serves a single use-case: file-system probing. And the patch does
exactly that.
> How about to add a separate func ubifs_read_node_silent to instead this
> ubifs_read_node in ubifs_read_sb_node? I think we could do more proper work
> in this new function.
This would introduce code duplication, and I am not sure if this is much
better than what Daniel suggests.
How about introducing a per-file-system flag, like c->probing or
something, and make do something like this:
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index a81c7b5..a627476 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1210,7 +1210,12 @@ static int mount_ubifs(struct ubifs_info *c)
c->mounting = 1;
+ /*
+ * Good commend describing what we are doing.
+ */
+ c->probing = 1
err = ubifs_read_superblock(c);
+ c->probing = 0
if (err)
goto out_free;
After all, we already have a number of "state" flags like 'c->mounting',
so adding another one is not that big deal.
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2014-05-28 8:02 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 [this message]
2014-05-28 8:07 ` Bityutskiy, Artem
2014-05-28 8:14 ` Artem Bityutskiy
2014-05-28 8:28 ` Artem Bityutskiy
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=1401264104.983.12.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).