Re: [PATCH] Btrfs: add checks to verify dir items are correct

2011-03-17 Thread Chris Mason
Excerpts from Josef Bacik's message of 2011-03-16 16:49:51 -0400: We need to make sure the dir items we get are valid dir items. So any time we try and read one check it with verify_dir_item, which will do various sanity checks to make sure it looks sane. Thanks, Nice, could you please add

Re: [PATCH 1/2] Btrfs: add datacow flag in inode flag

2011-03-17 Thread Amir Goldstein
On Thu, Mar 17, 2011 at 4:21 PM, Chris Mason chris.ma...@oracle.com wrote: Excerpts from liubo's message of 2011-03-16 22:10:09 -0400: On 03/16/2011 05:06 PM, Amir Goldstein wrote: On Wed, Mar 16, 2011 at 1:35 AM, Chris Mason chris.ma...@oracle.com wrote: Excerpts from Andreas Dilger's

Re: [PATCH] btrfs: quasi-round-robin for chunk allocation

2011-03-17 Thread Arne Jansen
On 09.02.2011 04:03, Miao Xie wrote: On tue, 8 Feb 2011 19:03:32 +0100, Arne Jansen wrote: In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a very uneven distribution, especially with RAID1 or RAID10 and an uneven

Re: How to implement raid1 repair

2011-03-17 Thread Josef Bacik
On Thu, Mar 17, 2011 at 03:46:43PM +0100, Jan Schmidt wrote: Hello everyone, Currently, btrfs has its own raid1 but no repair mechanism for bad checksums or EIOs. While trying to implement such a repair mechanism, several more or less general questions came up. There are two different

Re: How to implement raid1 repair

2011-03-17 Thread Jan Schmidt
On 03/17/2011 06:09 PM, Andrey Kuzmin wrote: On Thu, Mar 17, 2011 at 5:46 PM, Jan Schmidt list.bt...@jan-o-sch.net mailto:list.bt...@jan-o-sch.net wrote: - Is it acceptable to retry reading a block immediately after the disk said it won't work? Or in case of a successful read followed

Re: How to implement raid1 repair

2011-03-17 Thread Chris Mason
Excerpts from Jan Schmidt's message of 2011-03-17 13:37:54 -0400: On 03/17/2011 06:09 PM, Andrey Kuzmin wrote: On Thu, Mar 17, 2011 at 5:46 PM, Jan Schmidt list.bt...@jan-o-sch.net mailto:list.bt...@jan-o-sch.net wrote: - Is it acceptable to retry reading a block immediately after the

Re: How to implement raid1 repair

2011-03-17 Thread Andrey Kuzmin
On Thu, Mar 17, 2011 at 8:42 PM, Chris Mason chris.ma...@oracle.com wrote: Excerpts from Jan Schmidt's message of 2011-03-17 13:37:54 -0400: On 03/17/2011 06:09 PM, Andrey Kuzmin wrote: On Thu, Mar 17, 2011 at 5:46 PM, Jan Schmidt list.bt...@jan-o-sch.net mailto:list.bt...@jan-o-sch.net

Re: How to implement raid1 repair

2011-03-17 Thread Jan Schmidt
On 03/17/2011 06:36 PM, Chris Mason wrote: Excerpts from Jan Schmidt's message of 2011-03-17 10:46:43 -0400: Hello everyone, Currently, btrfs has its own raid1 but no repair mechanism for bad checksums or EIOs. While trying to implement such a repair mechanism, several more or less general

Re: How to implement raid1 repair

2011-03-17 Thread Jan Schmidt
(snipped the parts already commented on in the other mails just sent) On 03/17/2011 06:19 PM, Josef Bacik wrote: On Thu, Mar 17, 2011 at 03:46:43PM +0100, Jan Schmidt wrote: If either of the answers is no, tracking where the initial read came from seems inevitable. Tracking would be very easy

[PATCH] Btrfs: check items for correctness as we search V3

2011-03-17 Thread Josef Bacik
Currently if we have corrupted items things will blow up in spectacular ways. So as we read in blocks and they are leaves, check the entire leaf to make sure all of the items are correct and point to valid parts in the leaf for the item data the are responsible for. If the item is corrupt we will

[PATCH] Btrfs: add checks to verify dir items are correct V2

2011-03-17 Thread Josef Bacik
We need to make sure the dir items we get are valid dir items. So any time we try and read one check it with verify_dir_item, which will do various sanity checks to make sure it looks sane. Thanks, Signed-off-by: Josef Bacik jo...@redhat.com --- V1-V2: -Make it actually compile (oops!) -Check

[PATCH] btrfs scrub: extent_map reference not freed

2011-03-17 Thread Arne Jansen
scrub_chunk failed to free all extent_maps it referenced, leading to a leak of these maps on unmount. Reported-by: Ilya Dryomov idryo...@gmail.com Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/scrub.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git

[PATCH] Btrfs scrub: revised locking scheme

2011-03-17 Thread Arne Jansen
This patch removes unnecessary mutex locks around scrubs_running. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/scrub.c | 12 +++- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index ee7671f..85a4d4b 100644 ---

Re: [PATCH] Btrfs: check items for correctness as we search V3

2011-03-17 Thread Andrey Kuzmin
On Thu, Mar 17, 2011 at 9:18 PM, Josef Bacik jo...@redhat.com wrote: Currently if we have corrupted items things will blow up in spectacular ways. So as we read in blocks and they are leaves, check the entire leaf to make sure all of the items are correct and point to valid parts in the leaf

scrub git access

2011-03-17 Thread Arne Jansen
Hello all, The collection of patches is now also available via git at git://git.kernel.org/pub/scm/linux/kernel/git/arne/btrfs-unstable- arne.git and git://git.kernel.org/pub/scm/linux/kernel/git/arne/btrfs-progs-unstable- arne.git both in the 'scrub' branch. It is based on chris' current

Re: [PATCH] Btrfs: check items for correctness as we search V3

2011-03-17 Thread Chris Mason
Excerpts from Andrey Kuzmin's message of 2011-03-17 15:12:32 -0400: On Thu, Mar 17, 2011 at 9:18 PM, Josef Bacik jo...@redhat.com wrote: Currently if we have corrupted items things will blow up in spectacular ways. So as we read in blocks and they are leaves, check the entire leaf to make

Re: [PATCH] btrfs scrub: extent_map reference not freed

2011-03-17 Thread Li Zefan
Arne Jansen wrote: scrub_chunk failed to free all extent_maps it referenced, leading to a leak of these maps on unmount. Reported-by: Ilya Dryomov idryo...@gmail.com Signed-off-by: Arne Jansen sensi...@gmx.net I think it's better to fold those fix-up patches into your original scrub