Skip to contentSkip to conversation

Big fiability issue?

BUG Edward Shishkin 3 participants 6 messages Apr 5, 2016 – Apr 6, 2016

lore
Share & tools
lore
#0 lore raw

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature, which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.

Drop residual block barriers support.

---
 fs/reiser4/init_super.c |    2 --
 fs/reiser4/super.h      |    2 --
 fs/reiser4/wander.c     |   47 +++++++++++------------------------------------
 fs/reiser4/writeout.h   |    2 +-
 4 files changed, 12 insertions(+), 41 deletions(-)
fs/reiser4/init_super.c +0 -2
@@ -492,8 +492,6 @@ int reiser4_init_super_data(struct super
 	PUSH_BIT_OPT("dont_load_bitmap", REISER4_DONT_LOAD_BITMAP);
 	/* disable transaction commits during write() */
 	PUSH_BIT_OPT("atomic_write", REISER4_ATOMIC_WRITE);
-	/* disable use of write barriers in the reiser4 log writer. */
-	PUSH_BIT_OPT("no_write_barrier", REISER4_NO_WRITE_BARRIER);
 	/* enable issuing of discard requests */
 	PUSH_BIT_OPT("discard", REISER4_DISCARD);
 	/* disable hole punching at flush time */
fs/reiser4/super.h +0 -2
@@ -50,8 +50,6 @@ typedef enum {
 	REISER4_DONT_LOAD_BITMAP = 5,
 	/* enforce atomicity during write(2) */
 	REISER4_ATOMIC_WRITE = 6,
-	/* don't use write barriers in the log writer code. */
-	REISER4_NO_WRITE_BARRIER = 7,
 	/* enable issuing of discard requests */
 	REISER4_DISCARD = 8,
 	/* disable hole punching at flush time */
fs/reiser4/wander.c +11 -36

116 lines not on this page · raw message

fs/reiser4/writeout.h +1 -1
@@ -4,7 +4,7 @@
 
 #define WRITEOUT_SINGLE_STREAM (0x1)
 #define WRITEOUT_FOR_PAGE_RECLAIM  (0x2)
-#define WRITEOUT_BARRIER (0x4)
+#define WRITEOUT_FLUSH_FUA (0x4)
 
 extern int reiser4_get_writeout_flags(void);
 
#1 lore raw
Quoted 7 lines · Edward Shishkin

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature,
which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

Hm. Write barriers are not supported? man mount | grep barrier yields many results... or are they different barriers?

--
Ivan Shapovalov / intelfx /

Quoted 13 lines

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption
after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.

#3 lore raw
In reply to Edward Shishkin

Well, I did boot systemrescuecd to fsck my /dev/sda2 and mount it ro to do the backup and I was able to get all the data back but with a bonus :
I can mount the fscked /dev/sda2 in rw on systemrescuecd, the corruption don't come back. SystemrescueCD is based on Gentoo I think. But the one I got got a 3.18 kernel. I did manually compile the latest tools to be sure and a got an error because 3.18 support format40 4.0.0, not 4.0.1 but that error did not affect me.

I will do more test with that "corrupt" partition before restorating the backup.

Quoted 17 lines · On Tue, 5 Apr 2016 17:43:45 +0200 Edward Shishkin <[email protected]>…

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature, which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.

Signature · 1 line
Mathieu Belanger <[email protected]>
#4 lore raw

Another message, now, to confirm that everything is fine once booted on my main Gentoo, corruption do not come back. All directory (/opt, /mnt) are back and broken binaries are back alive too like nothing append.

So for now on until the reason is found, I will use sysrescuecd to do the fscks and mount it in rw there first and then reboot on my normal OS.

Mathieu

Quoted 39 lines · On Wed, 6 Apr 2016 09:25:40 -0500 Mathieu Belanger <[email protected]> wrote:

Well, I did boot systemrescuecd to fsck my /dev/sda2 and mount it ro to do the backup and I was able to get all the data back but with a bonus :
I can mount the fscked /dev/sda2 in rw on systemrescuecd, the corruption don't come back. SystemrescueCD is based on Gentoo I think. But the one I got got a 3.18 kernel. I did manually compile the latest tools to be sure and a got an error because 3.18 support format40 4.0.0, not 4.0.1 but that error did not affect me.

I will do more test with that "corrupt" partition before restorating the backup.

Quoted 17 lines · On Tue, 5 Apr 2016 17:43:45 +0200 Edward Shishkin <[email protected]>…

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature, which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.

Signature · 5 lines
Mathieu Belanger <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Mathieu Belanger <[email protected]>
#2 lore raw
In reply to Ivan Shapovalov

Hello Ivan,

Write barriers mean a proper ordering of writes. This is needed to guarantee consistency. For example, commit record should be written *after* writes of all journal blocks, etc. In reiser4 write barriers are always "on" by design.

There were 2 ways to provide such ordering: hardware and software ones. The hardware way assumes additional supports from the hard drive and the block layer. The Linux block layer had had such support ~6 years ago, however it was dropped then:
https://lwn.net/Articles/400541/
See also Linux/Documentation/block/barrier.txt in old kernels

Respectively, we should discontinue the "hardware barriers" support in reiser4 and unconditionally switch to the software implementation that we have for devices without hardware barriers support. I forgot to make such switch in due time.

Thanks,
Edward.

Quoted 26 lines · Ivan Shapovalov
Quoted 7 lines · Edward Shishkin

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature,
which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

Hm. Write barriers are not supported? man mount | grep barrier yields many results... or are they different barriers?

--
Ivan Shapovalov / intelfx /

Quoted 12 lines

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption
after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.

#5 lore raw
In reply to Mathieu Belanger
Quoted 5 lines · Mathieu Belanger

Well, I did boot systemrescuecd to fsck my /dev/sda2 and mount it ro to do the backup and I was able to get all the data back but with a bonus :
I can mount the fscked /dev/sda2 in rw on systemrescuecd, the corruption don't come back. SystemrescueCD is based on Gentoo I think. But the one I got got a 3.18 kernel.

Please, mount it with "no_write_barrier" option on all kernels older than 4.5.1 (not yet released). Horrible name, of course: this should sound like "no_block_write_barrier", or something like this, but it is too late to fix...

Thanks,
Edward.

Quoted 28 lines

I did manually compile the latest tools to be
sure and a got an error because 3.18 support format40 4.0.0, not 4.0.1 but that error did not affect me.

I will do more test with that "corrupt" partition before restorating the backup.

Quoted 17 lines · On Tue, 5 Apr 2016 17:43:45 +0200 Edward Shishkin <[email protected]>…

Hello Mathieu,

I found that by default reiser4 still relies on a block layer feature, which is not longer supported. This is so-called "barriers". And yes, on the power outage bad things are bound to happen. However, it is up to bad luck.

The attached patch removes the rest of block barriers support in reiser4. So, now we honestly wait for IO completion of wandered blocks (overwrite set) before submitting a journal header (journal footer).

Not sure if it will address your problem though. Also, data corruption after rw-mounting of checked (rebuild-fs) partition is still a concern.

Thanks,
Edward.