linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org
Subject: Re: UBIFS is not remounted read-only from within do_emergency_remount
Date: Fri, 24 Aug 2012 10:22:50 +0300	[thread overview]
Message-ID: <1345792970.2848.256.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <16202485.ui8ZXcNIqe@ws-stein>

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

On Tue, 2012-07-31 at 13:24 +0200, Alexander Stein wrote:
> upon testing do_emergency_remount from a power fail interrupt (using the 
> workqueue of course), we noticed UBIFS is not remounted read-only afterwards.
> The current code in do_emergency_remount checks if the kernel actually needs 
> to remount a filesystem using the following code:
> > if (sb->s_root && sb->s_bdev && (sb->s_flags & MS_BORN) &&
> >     !(sb->s_flags & MS_RDONLY)) {
> >         /*
> >          * What lock protects sb->s_flags??
> >          */
> >         do_remount_sb(sb, MS_RDONLY, NULL, 1);
> > }
> 
> I'm not in the details of this part of the kernel, but I suspect that sb-
> >s_bdev is NULL for UBIFS as it has no block device, but the character device 
> /dev/ubiX_Y instead. I have the information from a collegue that removing the 
> check for testing purposes for sb->s_bdev mounts UBIFS read-only.
> Any comments/ideas how to remount UBIFS as read-only from 
> do_emergency_remount?

I think this check is there to prevent file-systems like sysfs, tmpfs,
procfs, cgroup and debugfs from re-mounting R/O. If we just remove the
'sb->s_bdev' check - they all become R/O as well. For me it sounds OK,
but I've never used this functionality, so not sure.


-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-08-24  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 11:24 UBIFS is not remounted read-only from within do_emergency_remount Alexander Stein
2012-08-24  7:22 ` Artem Bityutskiy [this message]
2012-08-27  7:16   ` Alexander Stein

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=1345792970.2848.256.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=alexander.stein@systec-electronic.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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).