Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-24 Thread Chris Mason
Quoting Stefan Behrens (2013-10-23 13:21:34) On Tue, 22 Oct 2013 18:55:59 +0200, Bob Marley wrote: On 22/10/2013 10:37, Stefan Behrens wrote: I don't believe that this issue can ever happen. I don't believe that somewhere on the path to the flash memory, to the magnetic disc or to the

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-24 Thread Miao Xie
On thu, 24 Oct 2013 06:08:42 -0400, Chris Mason wrote: Quoting Stefan Behrens (2013-10-23 13:21:34) On Tue, 22 Oct 2013 18:55:59 +0200, Bob Marley wrote: On 22/10/2013 10:37, Stefan Behrens wrote: I don't believe that this issue can ever happen. I don't believe that somewhere on the path to

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-24 Thread Wang Shilong
On 10/24/2013 06:08 PM, Chris Mason wrote: Quoting Stefan Behrens (2013-10-23 13:21:34) On Tue, 22 Oct 2013 18:55:59 +0200, Bob Marley wrote: On 22/10/2013 10:37, Stefan Behrens wrote: I don't believe that this issue can ever happen. I don't believe that somewhere on the path to the flash

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-23 Thread Stefan Behrens
On Tue, 22 Oct 2013 18:55:59 +0200, Bob Marley wrote: On 22/10/2013 10:37, Stefan Behrens wrote: I don't believe that this issue can ever happen. I don't believe that somewhere on the path to the flash memory, to the magnetic disc or to the drive's cache memory, someone interrupts a 4KB write

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-22 Thread Stefan Behrens
On Sun, 20 Oct 2013 12:03:01 +0800, Wang Shilong wrote: On 10/19/2013 12:32, Shilong Wang wrote: 2013/10/19, Stefan Behrens sbehr...@giantdisaster.de: On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com Scrubing supers is not in a transaction context, when

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-20 Thread Bob Marley
On 19/10/2013 16:03, Stefan Behrens wrote: On 10/19/2013 12:32, Shilong Wang wrote: Yeah, it did not hurt. but it may output checksum mismatch. For example: Writing 4k superblock is not totally finished, but we are trying to scrub it. Have you ever seen this issue? ... If this is

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-19 Thread Stefan Behrens
On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we are trying to scrub supers.Fix it. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com ---

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-19 Thread Wang Shilong
On 10/19/2013 12:32, Shilong Wang wrote: 2013/10/19, Stefan Behrens sbehr...@giantdisaster.de: On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we

Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-19 Thread Wang Shilong
On 10/19/2013 12:32, Shilong Wang wrote: 2013/10/19, Stefan Behrens sbehr...@giantdisaster.de: On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we

[PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-18 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we are trying to scrub supers.Fix it. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- fs/btrfs/disk-io.c | 2 ++