Skip to contentSkip to conversation

write barrier over device mapper supported or not?

DISCUSSION Martin Steigerwald 2 participants 4 messages Dec 11, 2007 – Dec 12, 2007

lore
Share & tools
lore
#0 lore raw

Hello!

Are write barriers over device mapper supported or not?

On LVM2 xfs tells me:

Dec 11 23:00:09 shambala kernel: Filesystem "dm-0": Disabling barriers, 
not supported by the underlying device
Dec 11 23:00:09 shambala kernel: XFS mounting filesystem dm-0
Dec 11 23:00:09 shambala kernel: Ending clean XFS mount for filesystem: 

dm-0

But when I mount ext3 on LVM2 I get:

Dec 11 23:05:34 shambala kernel: kjournald starting.  Commit interval 5 
seconds
Dec 11 23:05:34 shambala kernel: EXT3 FS on dm-1, internal journal
Dec 11 23:05:34 shambala kernel: EXT3-fs: mounted filesystem with ordered 

data mode.

even when I explicetely specify "-o barrier=1" which should enable barriers on ext3.

As far as I understood from the changelogs as I wrote my Linux-Magazin I thought there should be device mapper support in the kernel, but I can not reproduce that finding anymore at the moment.

But back then I also looked at the ext3 / jbd sources and found that jbd issues a warning when barrier support is not available. However I do not find that one either.

And when I use reisferfs it also seems that write barriers are not available over LVM2:

Dec 11 23:34:58 shambala kernel: ReiserFS: dm-2: found reiserfs 
format "3.6" with standard journal
Dec 11 23:34:58 shambala kernel: ReiserFS: dm-2: using ordered data mode
Dec 11 23:34:58 shambala kernel: reiserfs: using flush barriers
Dec 11 23:34:58 shambala kernel: ReiserFS: dm-2: journal params: device 
dm-2, size 8192, journal first block 18, max trans len 1024, max batch 
900, max commit age 30, max trans age 30
Dec 11 23:34:58 shambala kernel: ReiserFS: dm-2: checking transaction log 
(dm-2)
Dec 11 23:35:01 shambala kernel: reiserfs: disabling flush barriers on 
dm-2
Dec 11 23:35:01 shambala kernel: ReiserFS: dm-2: Using r5 hash to sort 
names
Dec 11 23:35:01 shambala kernel: ReiserFS: dm-2: warning: 

Created .reiserfs_priv on dm-2 - reserved for xattr storage.

Hmmm... too bad... means I will likely not use LVM on my next laptop harddisk. I think I should file a kernel bug report about that. Anyone knows of any plans to support write barriers via device mapper? Well I guess I should ask on dm-devel or so if such a mailinglist exists.

Ciao,

Signature · 2 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
#1 lore raw
Quoted 3 lines · Martin Steigerwald

Hello!

Are write barriers over device mapper supported or not?

Nope.

see dm_request():

        /*
         * There is no use in forwarding any barrier request since we can't
         * guarantee it is (or can be) handled by the targets correctly.
         */
        if (unlikely(bio_barrier(bio))) {
                bio_endio(bio, -EOPNOTSUPP);
                return 0;
        }
Quoted 19 lines

On LVM2 xfs tells me:

Dec 11 23:00:09 shambala kernel: Filesystem "dm-0": Disabling barriers, 
not supported by the underlying device
Dec 11 23:00:09 shambala kernel: XFS mounting filesystem dm-0
Dec 11 23:00:09 shambala kernel: Ending clean XFS mount for filesystem: 

dm-0

But when I mount ext3 on LVM2 I get:

Dec 11 23:05:34 shambala kernel: kjournald starting.  Commit interval 5 
seconds
Dec 11 23:05:34 shambala kernel: EXT3 FS on dm-1, internal journal
Dec 11 23:05:34 shambala kernel: EXT3-fs: mounted filesystem with ordered 

data mode.

even when I explicetely specify "-o barrier=1" which should enable barriers on ext3.

Quoted 7 lines

As far as I understood from the changelogs as I wrote my Linux-Magazin I thought there should be device mapper support in the kernel, but I can not reproduce that finding anymore at the moment.

But back then I also looked at the ext3 / jbd sources and found that jbd issues a warning when barrier support is not available. However I do not find that one either.

in journal_write_commit_record() there is such a warning, but not in the mount path:

printk(KERN_WARNING
"JBD: barrier-based sync failed on %s - " "disabling barriers\n", bdevname(journal->j_dev, b));

and if I set barrier=1 on an lvm-root test box, I do get:

JBD: barrier-based sync failed on dm-0 - disabling barriers

-Eric

#2 lore raw

Am Mittwoch 12 Dezember 2007 schrieb Eric Sandeen:

Quoted 9 lines
Quoted 3 lines · Martin Steigerwald

Hello!

Are write barriers over device mapper supported or not?

Nope.

see dm_request():

Quoted 8 lines

/*
* There is no use in forwarding any barrier request since we
can't * guarantee it is (or can be) handled by the targets correctly. */

        if (unlikely(bio_barrier(bio))) {
                bio_endio(bio, -EOPNOTSUPP);
                return 0;
        }

Thanks for your definitive answer.

What does that mean? What is the target in that case? If it is the libata PATA internal notebook drive it actually should support barriers and then I actually would like device mapper to support them too. Or is LVM2 the target and device mapper can't tell that LVM2 supports it?

I ask myself the question why write barrier if half the kernel does not handle it correctly and I am limited to plain partitions if I want to use it? Well I think I will just file a bug report at kernel.bugzilla.org about it.

Ciao,

Signature · 2 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
#3 lore raw
In reply to Eric Sandeen

Am Mittwoch 12 Dezember 2007 schrieb Eric Sandeen:

Quoted 6 lines
Quoted 3 lines · Martin Steigerwald

Hello!

Are write barriers over device mapper supported or not?

Nope.

[...]

Quoted 7 lines
Quoted 3 lines

But back then I also looked at the ext3 / jbd sources and found that jbd issues a warning when barrier support is not available. However I do not find that one either.

in journal_write_commit_record() there is such a warning, but not in the mount path:

Quoted 8 lines

printk(KERN_WARNING
"JBD: barrier-based sync failed on %s - " "disabling barriers\n", bdevname(journal->j_dev, b));

and if I set barrier=1 on an lvm-root test box, I do get:

JBD: barrier-based sync failed on dm-0 - disabling barriers

Yes, I get it after actually touching a file and waiting for the kjournald commit interval of 5 seconds to occur.

Well I reported a bug about it, lets see what happens:

http://bugzilla.kernel.org/show_bug.cgi?id=9554

One might consider it being a feature wish of course.

Signature · 2 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7