2011-07-11 18:25:33

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 0/2] always default to issue cache flushes

It's bad enough that we still have filesystems who can't deal with
the volatile write caches present on all modern consumer disks, but
let's at least make use of this feature where present instead of
playing fast and lose with users data. Switch ext3 and reiserfs
to the same default already applied in btrfs, ext4, gfs2, hfsplus,
nilfs2 and XFS.


2011-07-11 18:26:03

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

From: Chris Mason <[email protected]>

This patch turns on barriers by default for ext3. mount -o barrier=0
will turn them off.

Acked-by: Jeff Mahoney <[email protected]>

Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2011-06-30 21:19:37.389544975 +0200
+++ linux-2.6/fs/ext3/super.c 2011-07-02 13:56:51.877784292 +0200
@@ -1718,6 +1718,8 @@ static int ext3_fill_super (struct super
sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
sbi->s_resgid = le16_to_cpu(es->s_def_resgid);

+ /* enable barriers by default */
+ set_opt(sbi->s_mount_opt, BARRIER);
set_opt(sbi->s_mount_opt, RESERVATION);

if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,

2011-07-11 18:26:23

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 2/2] reiserfs: make reiserfs default to barrier=flush

From: Jeff Mahoney <[email protected]>

Change the default reiserfs mount option to barrier=flush.

Signed-off-by: Jeff Mahoney <[email protected]>

Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2011-07-02 13:57:08.061117424 +0200
+++ linux-2.6/fs/reiserfs/super.c 2011-07-02 13:59:26.197782375 +0200
@@ -1643,6 +1643,7 @@ static int reiserfs_fill_super(struct su
/* Set default values for options: non-aggressive tails, RO on errors */
REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL);
REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO);
+ REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_BARRIER_FLUSH);
/* no preallocation minimum, be smart in
reiserfs_file_write instead */
REISERFS_SB(s)->s_alloc_options.preallocmin = 0;

2011-07-11 19:17:37

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

On Mon 11-07-11 14:25:59, Christoph Hellwig wrote:
> From: Chris Mason <[email protected]>
>
> This patch turns on barriers by default for ext3. mount -o barrier=0
> will turn them off.
>
> Acked-by: Jeff Mahoney <[email protected]>
This patch misses signed-off-by. Feel free to add
Acked-by: Jan Kara <[email protected]>

Honza

> Index: linux-2.6/fs/ext3/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ext3/super.c 2011-06-30 21:19:37.389544975 +0200
> +++ linux-2.6/fs/ext3/super.c 2011-07-02 13:56:51.877784292 +0200
> @@ -1718,6 +1718,8 @@ static int ext3_fill_super (struct super
> sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
> sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
>
> + /* enable barriers by default */
> + set_opt(sbi->s_mount_opt, BARRIER);
> set_opt(sbi->s_mount_opt, RESERVATION);
>
> if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
--
Jan Kara <[email protected]>
SUSE Labs, CR

2011-07-11 19:19:16

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH 0/2] always default to issue cache flushes

On Mon 11-07-11 14:25:33, Christoph Hellwig wrote:
> It's bad enough that we still have filesystems who can't deal with
> the volatile write caches present on all modern consumer disks, but
> let's at least make use of this feature where present instead of
> playing fast and lose with users data. Switch ext3 and reiserfs
> to the same default already applied in btrfs, ext4, gfs2, hfsplus,
> nilfs2 and XFS.
Maybe it's worth noting that both RH and SUSE distributions actually have
barriers switched on by default for years so this change isn't going to
affect most enterprise users.

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2011-07-11 19:20:09

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

On Mon, Jul 11, 2011 at 09:17:35PM +0200, Jan Kara wrote:
> On Mon 11-07-11 14:25:59, Christoph Hellwig wrote:
> > From: Chris Mason <[email protected]>
> >
> > This patch turns on barriers by default for ext3. mount -o barrier=0
> > will turn them off.
> >
> > Acked-by: Jeff Mahoney <[email protected]>
> This patch misses signed-off-by. Feel free to add
> Acked-by: Jan Kara <[email protected]>

I took it from the SuSE tree where it didn't have one either. I hope
Jeff can add one, but if not I think it's trivial enough to bother.


2011-07-11 22:23:10

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

On Mon, Jul 11, 2011 at 09:17:35PM +0200, Jan Kara wrote:
> On Mon 11-07-11 14:25:59, Christoph Hellwig wrote:
> > From: Chris Mason <[email protected]>
> >
> > This patch turns on barriers by default for ext3. mount -o barrier=0
> > will turn them off.
> >
> > Acked-by: Jeff Mahoney <[email protected]>
> This patch misses signed-off-by. Feel free to add
> Acked-by: Jan Kara <[email protected]>

I'm also completely in favor of this change.

- Ted

2011-07-12 00:16:27

by Eric Sandeen

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

On 7/11/11 1:25 PM, Christoph Hellwig wrote:
> From: Chris Mason <[email protected]>
>
> This patch turns on barriers by default for ext3. mount -o barrier=0
> will turn them off.
>
> Acked-by: Jeff Mahoney <[email protected]>
>
> Index: linux-2.6/fs/ext3/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ext3/super.c 2011-06-30 21:19:37.389544975 +0200
> +++ linux-2.6/fs/ext3/super.c 2011-07-02 13:56:51.877784292 +0200
> @@ -1718,6 +1718,8 @@ static int ext3_fill_super (struct super
> sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
> sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
>
> + /* enable barriers by default */
> + set_opt(sbi->s_mount_opt, BARRIER);
> set_opt(sbi->s_mount_opt, RESERVATION);
>
> if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,

Thank you, I hope it will get upstream THIS time ;)

As Jan said, despite uptream rejection last time, RHEL6 and SuSE have made this change anyway, because it's the Right Thing To Do.

Acked-by: Eric Sandeen <[email protected]>

-Eric

2011-07-12 13:26:54

by Chris Mason

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

Excerpts from Christoph Hellwig's message of 2011-07-11 14:25:59 -0400:
> From: Chris Mason <[email protected]>
>

Thanks for digging this out, you can toss in a sob for me. Probably
best to give yourself credit in the from:, since you went to all the
trouble of diving in the vendor kernels.

Then again, if you're using the old email to try and throw Andrew off
our trail, go for it.

-chris

> This patch turns on barriers by default for ext3. mount -o barrier=0
> will turn them off.
>
> Acked-by: Jeff Mahoney <[email protected]>
>
> Index: linux-2.6/fs/ext3/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ext3/super.c 2011-06-30 21:19:37.389544975 +0200
> +++ linux-2.6/fs/ext3/super.c 2011-07-02 13:56:51.877784292 +0200
> @@ -1718,6 +1718,8 @@ static int ext3_fill_super (struct super
> sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
> sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
>
> + /* enable barriers by default */
> + set_opt(sbi->s_mount_opt, BARRIER);
> set_opt(sbi->s_mount_opt, RESERVATION);
>
> if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,

2011-07-14 15:19:09

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext3: make ext3 mount default to barrier=1

On Tue, Jul 12, 2011 at 09:24:47AM -0400, Chris Mason wrote:
> Excerpts from Christoph Hellwig's message of 2011-07-11 14:25:59 -0400:
> > From: Chris Mason <[email protected]>
> >
>
> Thanks for digging this out, you can toss in a sob for me. Probably
> best to give yourself credit in the from:, since you went to all the
> trouble of diving in the vendor kernels.
>
> Then again, if you're using the old email to try and throw Andrew off
> our trail, go for it.

Given that it's trivial one liners, and suse actually had config options
around them that I had to remove I might as well claim the patches as
mine. I'll resend them with my From and Signoff lines.