linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: force ro mount if ext3_setup_super() fails
@ 2012-05-24 17:00 Eric Sandeen
  2012-05-24 17:01 ` [PATCH V2] ext4: force ro mount if ext4_setup_super() fails Eric Sandeen
  2012-05-24 17:30 ` [PATCH] ext4: force ro mount if ext3_setup_super() fails Andreas Dilger
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2012-05-24 17:00 UTC (permalink / raw)
  To: ext4 development

If ext4_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.ext4 -r 4 /dev/sdb6
# mount /dev/sdb6 /mnt/test
# dmesg | grep "too high"
[164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
# grep sdb6 /proc/mounts
/dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
                          ^^

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e1fb1d5..be67c0b 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3592,7 +3592,8 @@ no_journal:
 		goto failed_mount4;
 	}
 
-	ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
+	if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
+		sb->s_flags |= MS_RDONLY;
 
 	/* determine the minimum size of new large inodes, if present */
 	if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH V2] ext4: force ro mount if ext4_setup_super() fails
  2012-05-24 17:00 [PATCH] ext4: force ro mount if ext3_setup_super() fails Eric Sandeen
@ 2012-05-24 17:01 ` Eric Sandeen
  2012-05-24 17:30   ` Andreas Dilger
  2012-05-28 17:53   ` Ted Ts'o
  2012-05-24 17:30 ` [PATCH] ext4: force ro mount if ext3_setup_super() fails Andreas Dilger
  1 sibling, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2012-05-24 17:01 UTC (permalink / raw)
  To: ext4 development

If ext4_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.ext4 -r 4 /dev/sdb6
# mount /dev/sdb6 /mnt/test
# dmesg | grep "too high"
[164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
# grep sdb6 /proc/mounts
/dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
                          ^^

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2, fix subject C&P error, oops.

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e1fb1d5..be67c0b 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3592,7 +3592,8 @@ no_journal:
 		goto failed_mount4;
 	}
 
-	ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
+	if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
+		sb->s_flags |= MS_RDONLY;
 
 	/* determine the minimum size of new large inodes, if present */
 	if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {

--
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 related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] ext4: force ro mount if ext4_setup_super() fails
  2012-05-24 17:01 ` [PATCH V2] ext4: force ro mount if ext4_setup_super() fails Eric Sandeen
@ 2012-05-24 17:30   ` Andreas Dilger
  2012-05-28 17:53   ` Ted Ts'o
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Dilger @ 2012-05-24 17:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On 2012-05-24, at 11:01 AM, Eric Sandeen wrote:
> If ext4_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.ext4 -r 4 /dev/sdb6
> # mount /dev/sdb6 /mnt/test
> # dmesg | grep "too high"
> [164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
> # grep sdb6 /proc/mounts
> /dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
>                          ^^
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Andreas Dilger <adilger@whamcloud.com>

> ---
> 
> V2, fix subject C&P error, oops.
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index e1fb1d5..be67c0b 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3592,7 +3592,8 @@ no_journal:
> 		goto failed_mount4;
> 	}
> 
> -	ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
> +	if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
> +		sb->s_flags |= MS_RDONLY;
> 
> 	/* determine the minimum size of new large inodes, if present */
> 	if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
> 
> --
> 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
> 
> 
> --
> 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] 5+ messages in thread

* Re: [PATCH] ext4: force ro mount if ext3_setup_super() fails
  2012-05-24 17:00 [PATCH] ext4: force ro mount if ext3_setup_super() fails Eric Sandeen
  2012-05-24 17:01 ` [PATCH V2] ext4: force ro mount if ext4_setup_super() fails Eric Sandeen
@ 2012-05-24 17:30 ` Andreas Dilger
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Dilger @ 2012-05-24 17:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On 2012-05-24, at 11:00 AM, Eric Sandeen wrote:
> If ext4_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.ext4 -r 4 /dev/sdb6
> # mount /dev/sdb6 /mnt/test
> # dmesg | grep "too high"
> [164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
> # grep sdb6 /proc/mounts
> /dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
>                          ^^
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Andreas Dilger <adilger@whamcloud.com>

> ---
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index e1fb1d5..be67c0b 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3592,7 +3592,8 @@ no_journal:
> 		goto failed_mount4;
> 	}
> 
> -	ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
> +	if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
> +		sb->s_flags |= MS_RDONLY;
> 
> 	/* determine the minimum size of new large inodes, if present */
> 	if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
> 
> --
> 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] 5+ messages in thread

* Re: [PATCH V2] ext4: force ro mount if ext4_setup_super() fails
  2012-05-24 17:01 ` [PATCH V2] ext4: force ro mount if ext4_setup_super() fails Eric Sandeen
  2012-05-24 17:30   ` Andreas Dilger
@ 2012-05-28 17:53   ` Ted Ts'o
  1 sibling, 0 replies; 5+ messages in thread
From: Ted Ts'o @ 2012-05-28 17:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On Thu, May 24, 2012 at 12:01:43PM -0500, Eric Sandeen wrote:
> If ext4_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.ext4 -r 4 /dev/sdb6
> # mount /dev/sdb6 /mnt/test
> # dmesg | grep "too high"
> [164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
> # grep sdb6 /proc/mounts
> /dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-28 17:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 17:00 [PATCH] ext4: force ro mount if ext3_setup_super() fails Eric Sandeen
2012-05-24 17:01 ` [PATCH V2] ext4: force ro mount if ext4_setup_super() fails Eric Sandeen
2012-05-24 17:30   ` Andreas Dilger
2012-05-28 17:53   ` Ted Ts'o
2012-05-24 17:30 ` [PATCH] ext4: force ro mount if ext3_setup_super() fails Andreas Dilger

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).