Re: [PATCH v2 3/6] btrfs: add scrub code and prototypes

2011-03-12 Thread Arne Jansen
Hi David, thanks for your reviews. I'll update the code accordingly, comments follow inline. -- Arne David Sterba wrote: On Fri, Mar 11, 2011 at 03:49:40PM +0100, Arne Jansen wrote: This is the main scrub code. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/Makefile |2 +-

Re: [PATCH v2 5/6] btrfs: add state information for scrub

2011-03-12 Thread Arne Jansen
David Sterba wrote: On Fri, Mar 11, 2011 at 03:49:42PM +0100, Arne Jansen wrote: Add structures and state information needed for scrub Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h | 26 ++ fs/btrfs/disk-io.c | 15 +++

Re: [PATCH v2 0/6] btrfs: scrub

2011-03-12 Thread Arne Jansen
Ric Wheeler wrote: On 03/11/2011 09:49 AM, Arne Jansen wrote: Great work! I do wonder if we should also worry about the unallocated part of the storage device. Often, with local disks specifically, your unused space might accumulate errors over time. What you add to your scrub phase is a

[PATCH v3 4/6] btrfs: sync scrub with commit device removal

2011-03-12 Thread Arne Jansen
This adds several synchronizations: - for a transaction commit, the scrub gets paused before the tree roots are committed until the super are safely on disk - during a log commit, scrubbing of supers is disabled - on unmount, the scrub gets cancelled - on device removal, the scrub for the

[PATCH v3 2/6] btrfs: make struct map_lookup public

2011-03-12 Thread Arne Jansen
definition of struct map_lookup moved from volumes.c to the header Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/volumes.c | 14 -- fs/btrfs/volumes.h | 14 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/volumes.c

[PATCH v3 0/6] btrfs: scrub

2011-03-12 Thread Arne Jansen
This series adds an initial implementation for scrub. It works quite straightforward. The usermode issues an ioctl for each device in the fs. For each device, it enumerates the allocated device chunks. For each chunk, the contained extents are enumerated and the data checksums fetched. The extents

[PATCH v3 6/6] btrfs: new ioctls for scrub

2011-03-12 Thread Arne Jansen
From: Jan Schmidt list.bt...@jan-o-sch.net adds ioctls necessary to start and cancel scrubs, to get current progress and to get info about devices to be scrubbed. Note that the scrub is done per-device and that the ioctl only returns after the scrub for this devices is finished or has been

[PATCH v3 1/6] btrfs: add parameter to btrfs_lookup_csum_range

2011-03-12 Thread Arne Jansen
A parameter is added to search the commit root instead of the live root. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h |4 ++-- fs/btrfs/file-item.c |8 +++- fs/btrfs/inode.c |2 +- fs/btrfs/relocation.c |2 +- fs/btrfs/tree-log.c |4 ++--

[PATCH v3 5/6] btrfs: add state information for scrub

2011-03-12 Thread Arne Jansen
Add structures and state information needed for scrub Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h | 25 + fs/btrfs/disk-io.c | 15 +++ fs/btrfs/ioctl.h | 17 + fs/btrfs/volumes.h |3 +++ 4 files changed, 60

[PATCH v3 3/6] btrfs: add scrub code and prototypes

2011-03-12 Thread Arne Jansen
This is the main scrub code. Updates v3: - fixed EIO handling, need to reallocate bio instead of reusing it - Updated according to David Sterba's review - don't clobber bi_flags on reuse, just set UPTODATE - allocate long living bios with bio_kmalloc instead of bio_alloc Signed-off-by: Arne

[PATCH v1 0/3] btrfs-progs: scrub interface

2011-03-12 Thread Jan Schmidt
This patch set for btrfs-progs is meant to be used together with the scrub kernel patches submitted by Arne Jansen (latest Subject: [PATCH v3 0/6] btrfs: scrub). Short usage: A scrub process for all devices of a (mounted) file system can be startet with: btrfs filesystem scrub start /mnt/btrfs

[PATCH v1 1/3] commands added

2011-03-12 Thread Jan Schmidt
- scrub commands added - open_file_or_dir no longer static (needed by scrub.c) Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- Makefile |4 ++-- btrfs.c | 12 btrfs_cmds.c |3 ++- btrfs_cmds.h |4 4 files changed, 20 insertions(+), 3 deletions(-)

[PATCH v1 3/3] added scrub functionality

2011-03-12 Thread Jan Schmidt
Known issues: - scrub status has quite some lag as it only reads the status file periodically written by the background process. Next step would be to implement some kind of interaction between both processes to get more up to date results while a scrub is running - The locking in the code is

Re: [PATCH v1 0/3] btrfs-progs: scrub interface

2011-03-12 Thread Hubert Kario
On Saturday 12 of March 2011 19:31:32 Jan Schmidt wrote: This patch set for btrfs-progs is meant to be used together with the scrub kernel patches submitted by Arne Jansen (latest Subject: [PATCH v3 0/6] btrfs: scrub). (snip) Makefile |4 +- btrfs.c | 12 + btrfs_cmds.c |

Re: BTRFS fsck tool

2011-03-12 Thread Spelic
On 03/10/2011 02:02 PM, Chris Mason wrote: Cutting the power isn't problem unless you're using something where cache flushes are not supported. Some disks lie about cache flush having completed. But why doesn't the option for mounting with an earlier superblock work? Could you improve that

Re: BTRFS fsck tool

2011-03-12 Thread Ric Wheeler
On 03/12/2011 05:49 PM, Spelic wrote: On 03/10/2011 02:02 PM, Chris Mason wrote: Cutting the power isn't problem unless you're using something where cache flushes are not supported. Some disks lie about cache flush having completed. This is really not true for modern enterprise class drives.

Re: btrfs fi df returns nothing

2011-03-12 Thread Chris Samuel
On Wed, 9 Mar 2011 10:47:46 PM Hugo Mills wrote: [Ubuntu 10.04 LTS kernel - 2.6.32 based] Ouch. That's a very early kernel, in btrfs terms. That may be true, but as someone who's been running btrfs as /home on laptop SSD's for over 2 years now the reports from people using later kernels worried