* [PATCH] ext3: force ro mount if ext3_setup_super() fails
@ 2012-05-24 17:00 Eric Sandeen
2012-05-24 17:41 ` Andreas Dilger
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2012-05-24 17:00 UTC (permalink / raw)
To: ext4 development
If ext3_setup_super() fails i.e. due to a too-high revision,
the error is logged in dmesg but the fs is not mounted RO as
indicated.
Tested by:
# mkfs.ext3 -r 4 /dev/sdb6
# mount /dev/sdb6 /mnt/test
# dmesg | grep "too high"
[164152.114551] EXT3-fs (sdb6): error: revision level too high, forcing read-only mode
# grep sdb6 /proc/mounts
/dev/sdb6 /mnt/test2 ext3 rw,seclabel,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
^^
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index cf0b592..fef7af2 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2043,7 +2043,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
goto failed_mount3;
}
- ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
+ if (ext3_setup_super(sb, es, sb->s_flags & MS_RDONLY))
+ sb->s_flags |= MS_RDONLY;
EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
ext3_orphan_cleanup(sb, es);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext3: force ro mount if ext3_setup_super() fails
2012-05-24 17:00 [PATCH] ext3: force ro mount if ext3_setup_super() fails Eric Sandeen
@ 2012-05-24 17:41 ` Andreas Dilger
2012-05-29 14:09 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2012-05-24 17:41 UTC (permalink / raw)
To: Eric Sandeen; +Cc: ext4 development
On 2012-05-24, at 11:00 AM, Eric Sandeen wrote:
> If ext3_setup_super() fails i.e. due to a too-high revision,
> the error is logged in dmesg but the fs is not mounted RO as
> indicated.
>
> Tested by:
>
> # mkfs.ext3 -r 4 /dev/sdb6
> # mount /dev/sdb6 /mnt/test
> # dmesg | grep "too high"
> [164152.114551] EXT3-fs (sdb6): error: revision level too high, forcing read-only mode
> # grep sdb6 /proc/mounts
> /dev/sdb6 /mnt/test2 ext3 rw,seclabel,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
> ^^
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
> ---
>
> diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> index cf0b592..fef7af2 100644
> --- a/fs/ext3/super.c
> +++ b/fs/ext3/super.c
> @@ -2043,7 +2043,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
> goto failed_mount3;
> }
>
> - ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
> + if (ext3_setup_super(sb, es, sb->s_flags & MS_RDONLY))
> + sb->s_flags |= MS_RDONLY;
I was wondering if this should be:
sb->s_flags |= ext3_setup_super(...)
but that might be over-thinking things.
> EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
> ext3_orphan_cleanup(sb, es);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers, Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext3: force ro mount if ext3_setup_super() fails
2012-05-24 17:41 ` Andreas Dilger
@ 2012-05-29 14:09 ` Jan Kara
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2012-05-29 14:09 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Eric Sandeen, ext4 development
On Thu 24-05-12 11:41:57, Andreas Dilger wrote:
> On 2012-05-24, at 11:00 AM, Eric Sandeen wrote:
> > If ext3_setup_super() fails i.e. due to a too-high revision,
> > the error is logged in dmesg but the fs is not mounted RO as
> > indicated.
> >
> > Tested by:
> >
> > # mkfs.ext3 -r 4 /dev/sdb6
> > # mount /dev/sdb6 /mnt/test
> > # dmesg | grep "too high"
> > [164152.114551] EXT3-fs (sdb6): error: revision level too high, forcing read-only mode
> > # grep sdb6 /proc/mounts
> > /dev/sdb6 /mnt/test2 ext3 rw,seclabel,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
> > ^^
> >
> > Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>
> Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Thanks! Merged to my tree.
Honza
> > ---
> >
> > diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> > index cf0b592..fef7af2 100644
> > --- a/fs/ext3/super.c
> > +++ b/fs/ext3/super.c
> > @@ -2043,7 +2043,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
> > goto failed_mount3;
> > }
> >
> > - ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
> > + if (ext3_setup_super(sb, es, sb->s_flags & MS_RDONLY))
> > + sb->s_flags |= MS_RDONLY;
>
> I was wondering if this should be:
>
> sb->s_flags |= ext3_setup_super(...)
>
> but that might be over-thinking things.
>
> > EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
> > ext3_orphan_cleanup(sb, es);
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
> Cheers, Andreas
>
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-29 14:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 17:00 [PATCH] ext3: force ro mount if ext3_setup_super() fails Eric Sandeen
2012-05-24 17:41 ` Andreas Dilger
2012-05-29 14:09 ` Jan Kara
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).