linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev
@ 2010-09-26 22:38 Maciej Żenczykowski
  2010-09-26 22:38 ` [PATCH 2/2] ext4: " Maciej Żenczykowski
  2010-11-08  1:09 ` [PATCH 1/2] ext3: " Maciej Żenczykowski
  0 siblings, 2 replies; 4+ messages in thread
From: Maciej Żenczykowski @ 2010-09-26 22:38 UTC (permalink / raw)
  To: linux-ext4; +Cc: Maciej Żenczykowski, Theodore Ts'o

An ext3 filesystem on a read-only device, with an external journal
which is at a different device number then recorded in the superblock
will fail to honor the read-only setting of the device and trigger
a superblock update (write).

For example:
  - ext3 on a software raid which is in read-only mode
  - external journal on a read-write device which has changed device num
  - attempt to mount with -o journal_dev=<new_number>
  - hits BUG_ON(mddev->ro = 1) in md.c

Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Maciej Żenczykowski <zenczykowski@gmail.com>
---
 fs/ext3/super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 5dbf4db..19dfbe9 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2299,7 +2299,7 @@ static int ext3_load_journal(struct super_block *sb,
 	EXT3_SB(sb)->s_journal = journal;
 	ext3_clear_journal_err(sb, es);
 
-	if (journal_devnum &&
+	if (!really_read_only && journal_devnum &&
 	    journal_devnum != le32_to_cpu(es->s_journal_dev)) {
 		es->s_journal_dev = cpu_to_le32(journal_devnum);
 
-- 
1.7.2.3

--
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] 4+ messages in thread

* [PATCH 2/2] ext4: don't update sb journal_devnum when RO dev
  2010-09-26 22:38 [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev Maciej Żenczykowski
@ 2010-09-26 22:38 ` Maciej Żenczykowski
  2010-11-08  1:09 ` [PATCH 1/2] ext3: " Maciej Żenczykowski
  1 sibling, 0 replies; 4+ messages in thread
From: Maciej Żenczykowski @ 2010-09-26 22:38 UTC (permalink / raw)
  To: linux-ext4; +Cc: Maciej Żenczykowski, Theodore Ts'o

An ext4 filesystem on a read-only device, with an external journal
which is at a different device number then recorded in the superblock
will fail to honor the read-only setting of the device and trigger
a superblock update (write).

For example:
  - ext4 on a software raid which is in read-only mode
  - external journal on a read-write device which has changed device num
  - attempt to mount with -o journal_dev=<new_number>
  - hits BUG_ON(mddev->ro = 1) in md.c

Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Maciej Żenczykowski <zenczykowski@gmail.com>
---
 fs/ext4/super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2614774..48388c7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3470,7 +3470,7 @@ static int ext4_load_journal(struct super_block *sb,
 	EXT4_SB(sb)->s_journal = journal;
 	ext4_clear_journal_err(sb, es);
 
-	if (journal_devnum &&
+	if (!really_read_only && journal_devnum &&
 	    journal_devnum != le32_to_cpu(es->s_journal_dev)) {
 		es->s_journal_dev = cpu_to_le32(journal_devnum);
 
-- 
1.7.2.3

--
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] 4+ messages in thread

* Re: [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev
  2010-09-26 22:38 [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev Maciej Żenczykowski
  2010-09-26 22:38 ` [PATCH 2/2] ext4: " Maciej Żenczykowski
@ 2010-11-08  1:09 ` Maciej Żenczykowski
  2010-11-08 12:15   ` Jan Kara
  1 sibling, 1 reply; 4+ messages in thread
From: Maciej Żenczykowski @ 2010-11-08  1:09 UTC (permalink / raw)
  To: linux-ext4, Andrew Morton, Andreas Dilger, Jan Kara,
	Christoph Hellwig, Eric Sandeen <sandee
  Cc: Maciej Żenczykowski

2010/9/26 Maciej Żenczykowski <zenczykowski@gmail.com>:
> An ext3 filesystem on a read-only device, with an external journal
> which is at a different device number then recorded in the superblock
> will fail to honor the read-only setting of the device and trigger
> a superblock update (write).
>
> For example:
>  - ext3 on a software raid which is in read-only mode
>  - external journal on a read-write device which has changed device num
>  - attempt to mount with -o journal_dev=<new_number>
>  - hits BUG_ON(mddev->ro = 1) in md.c
>
> Cc: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Maciej Żenczykowski <zenczykowski@gmail.com>
> ---
>  fs/ext3/super.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> index 5dbf4db..19dfbe9 100644
> --- a/fs/ext3/super.c
> +++ b/fs/ext3/super.c
> @@ -2299,7 +2299,7 @@ static int ext3_load_journal(struct super_block *sb,
>        EXT3_SB(sb)->s_journal = journal;
>        ext3_clear_journal_err(sb, es);
>
> -       if (journal_devnum &&
> +       if (!really_read_only && journal_devnum &&
>            journal_devnum != le32_to_cpu(es->s_journal_dev)) {
>                es->s_journal_dev = cpu_to_le32(journal_devnum);
>
> --
> 1.7.2.3
>
>

While I can see the ext4 patch at:

 http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=shortlog

I can't find the ext3 patch.  Did it get missed?

Maciej
--
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] 4+ messages in thread

* Re: [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev
  2010-11-08  1:09 ` [PATCH 1/2] ext3: " Maciej Żenczykowski
@ 2010-11-08 12:15   ` Jan Kara
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2010-11-08 12:15 UTC (permalink / raw)
  To: Maciej Żenczykowski
  Cc: linux-ext4, Andrew Morton, Andreas Dilger, Jan Kara,
	Christoph Hellwig, Eric Sandeen, Dmitry Monakhov,
	Theodore Ts'o

On Sun 07-11-10 17:09:24, Maciej Żenczykowski wrote:
> 2010/9/26 Maciej Żenczykowski <zenczykowski@gmail.com>:
> > An ext3 filesystem on a read-only device, with an external journal
> > which is at a different device number then recorded in the superblock
> > will fail to honor the read-only setting of the device and trigger
> > a superblock update (write).
> >
> > For example:
> >  - ext3 on a software raid which is in read-only mode
> >  - external journal on a read-write device which has changed device num
> >  - attempt to mount with -o journal_dev=<new_number>
> >  - hits BUG_ON(mddev->ro = 1) in md.c
> >
> > Cc: Theodore Ts'o <tytso@mit.edu>
> > Signed-off-by: Maciej Żenczykowski <zenczykowski@gmail.com>
> > ---
> >  fs/ext3/super.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> > index 5dbf4db..19dfbe9 100644
> > --- a/fs/ext3/super.c
> > +++ b/fs/ext3/super.c
> > @@ -2299,7 +2299,7 @@ static int ext3_load_journal(struct super_block *sb,
> >        EXT3_SB(sb)->s_journal = journal;
> >        ext3_clear_journal_err(sb, es);
> >
> > -       if (journal_devnum &&
> > +       if (!really_read_only && journal_devnum &&
> >            journal_devnum != le32_to_cpu(es->s_journal_dev)) {
> >                es->s_journal_dev = cpu_to_le32(journal_devnum);
> >
> > --
> > 1.7.2.3
> >
> >
> 
> While I can see the ext4 patch at:
> 
>  http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=shortlog
> 
> I can't find the ext3 patch.  Did it get missed?
  Yes, it seems so. I'm taking care of ext3 so please CC me directly for
ext3 fixes. Thanks! I'll merge this fix.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
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] 4+ messages in thread

end of thread, other threads:[~2010-11-08 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26 22:38 [PATCH 1/2] ext3: don't update sb journal_devnum when RO dev Maciej Żenczykowski
2010-09-26 22:38 ` [PATCH 2/2] ext4: " Maciej Żenczykowski
2010-11-08  1:09 ` [PATCH 1/2] ext3: " Maciej Żenczykowski
2010-11-08 12:15   ` 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).