Re: Problems with nodatacow/nodatasum

2012-04-20 Thread Chris Mason
On Fri, Apr 20, 2012 at 12:22:11PM +0300, Avi Kivity wrote: > On Fri, Apr 20, 2012 at 12:12 PM, David Sterba wrote: > > On Fri, Apr 20, 2012 at 11:19:39AM +0300, Avi Kivity wrote: > >>   /dev/mapper/luks-blah /                       btrfs > >> subvol=/rootvol        1 1 > >>   /dev/mapper/luks-bla

Implementing encryption. Any specs?

2012-04-20 Thread Amadeus G.
Hi, I would like to make a go at implementing encryption. Can anyone provide specs for how it should be? Regards A.G. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/maj

Re: [PATCH v3] btrfs: fix early abort in 'remount'

2012-04-20 Thread Josef Bacik
On Thu, Apr 19, 2012 at 01:27:38AM +0300, Sergei Trofimovich wrote: > From: Sergei Trofimovich > > Cc: Jeff Mahoney > Cc: Chris Mason > Reviewed-by: Josef Bacik > Reviewed-by: Sergey V. > Signed-off-by: Sergei Trofimovich > --- > v1->v2: fixed indentation of 'if (cond) {' suggested by Liu Bo

[PATCH] Btrfs: end writeback on pages before finishing ordered extents

2012-04-20 Thread Josef Bacik
So we have a slight deadlock issue where somebody will be trying to make an allocation while holding a tree lock and then be forced to wait while we flush out data. Well our flushers will then try to finish the ordered io and get stuck on this lock and we will deadlock. The thing is we don't real

[PATCHv2 2/4] restore: don't corrupt stack for a zero-length command-line argument

2012-04-20 Thread Jim Meyering
From: Jim Meyering Given a zero-length directory name, the trailing-slash removal code would test dir_name[-1], and if it were found to be a slash, would set it to '\0'. Reviewed-by: Josef Bacik --- restore.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/restor

[PATCHv2 3/4] avoid several strncpy-induced buffer overruns

2012-04-20 Thread Jim Meyering
From: Jim Meyering * restore.c (main): Ensure strncpy-copied dir_name is NUL-terminated. * btrfsctl.c (main): Likewise, for a command-line argument. * utils.c (multiple functions): Likewise. * btrfs-list.c (add_root): Likewise. * btrfslabel.c (change_label_unmounted): Likewise. * cmds-device.c (c

[PATCHv2 4/4] mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg

2012-04-20 Thread Jim Meyering
From: Jim Meyering * mkfs.c (parse_size): ./mkfs.btrfs -A '' would read and possibly write the byte before beginning of strdup'd heap buffer. All other size-accepting options were similarly affected. Reviewed-by: Josef Bacik --- cmds-subvolume.c |2 +- mkfs.c |2 +- 2 files

[PATCHv2 1/4] mkfs: use strdup in place of strlen,malloc,strcpy sequence

2012-04-20 Thread Jim Meyering
From: Jim Meyering * mkfs.c (traverse_directory): No semantic change. Reviewed-by: Josef Bacik --- mkfs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkfs.c b/mkfs.c index c531ef2..03239fb 100644 --- a/mkfs.c +++ b/mkfs.c @@ -911,8 +911,7 @@ static int traverse_dir

btrfs-progs: minor buffer-overrun fixes (v2)

2012-04-20 Thread Jim Meyering
Same net result as before, but with the stray-parenthesis fix moved to 2/4 where it belongs, rather than buried in 3/4. Thanks to Josef for the reviews. Also, I fixed this in 3/4: - args.name[BTRFS_PATH_NAME_MAX-1] = 0; + args.name[BTRFS_SUBVOL_NAME_MAX-1] = 0; [PATCHv2 1/4] mkfs: use

Re: [PATCH 3/4] avoid strncpy-induced buffer overrun

2012-04-20 Thread Jim Meyering
Josef Bacik wrote: > On Fri, Apr 20, 2012 at 07:36:47PM +0200, Jim Meyering wrote: >> From: Jim Meyering >> >> * restore.c (main): Ensure strncpy-copied dir_name is NUL-terminated. >> * btrfsctl.c (main): Likewise, for a command-line argument. >> * utils.c (multiple functions): Likewise. >> * btrf

Re: [PATCH 3/4] avoid strncpy-induced buffer overrun

2012-04-20 Thread Josef Bacik
On Fri, Apr 20, 2012 at 07:36:47PM +0200, Jim Meyering wrote: > From: Jim Meyering > > * restore.c (main): Ensure strncpy-copied dir_name is NUL-terminated. > * btrfsctl.c (main): Likewise, for a command-line argument. > * utils.c (multiple functions): Likewise. > * btrfs-list.c (add_root): Likew

Re: [PATCH 4/4] mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg

2012-04-20 Thread Josef Bacik
On Fri, Apr 20, 2012 at 07:36:48PM +0200, Jim Meyering wrote: > From: Jim Meyering > > * mkfs.c (parse_size): ./mkfs.btrfs -A '' would read and possibly > write the byte before beginning of strdup'd heap buffer. All other > size-accepting options were similarly affected. > --- > mkfs.c |2 +

kernel bug in 3.4.0-rc3 after disconnecting/reconnecting drives

2012-04-20 Thread Remco Hosman
I managed to brake my test filesystem after several times disconnecting 1 disk, reconnecting it, disconnecting all disks at the same time (unplugging the USB enclosure they are in) and things like that. when i try to mount, i get this error in dmesg: [ 46.645732] btrfs: use zlib compression [

Re: [PATCH 2/4] restore: don't corrupt stack for a zero-length command-line argument

2012-04-20 Thread Josef Bacik
On Fri, Apr 20, 2012 at 07:36:46PM +0200, Jim Meyering wrote: > From: Jim Meyering > > Given a zero-length directory name, the trailing-slash removal > code would test dir_name[-1], and if it were found to be a slash, > would set it to '\0'. > --- > restore.c |8 +++- > 1 file changed, 3

Re: [PATCH 2/4] restore: don't corrupt stack for a zero-length command-line argument

2012-04-20 Thread Josef Bacik
On Fri, Apr 20, 2012 at 07:36:46PM +0200, Jim Meyering wrote: > From: Jim Meyering > > Given a zero-length directory name, the trailing-slash removal > code would test dir_name[-1], and if it were found to be a slash, > would set it to '\0'. > --- > restore.c |8 +++- > 1 file changed, 3

Re: [PATCH 1/4] mkfs: use strdup in place of strlen,malloc,strcpy sequence

2012-04-20 Thread Josef Bacik
On Fri, Apr 20, 2012 at 07:36:45PM +0200, Jim Meyering wrote: > From: Jim Meyering > > * mkfs.c (traverse_directory): No semantic change. > --- > mkfs.c |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mkfs.c b/mkfs.c > index c531ef2..03239fb 100644 > --- a/mkfs.c >

[PATCH 3/4] avoid strncpy-induced buffer overrun

2012-04-20 Thread Jim Meyering
From: Jim Meyering * restore.c (main): Ensure strncpy-copied dir_name is NUL-terminated. * btrfsctl.c (main): Likewise, for a command-line argument. * utils.c (multiple functions): Likewise. * btrfs-list.c (add_root): Likewise. * btrfslabel.c (change_label_unmounted): Likewise. * cmds-device.c (c

[PATCH 2/4] restore: don't corrupt stack for a zero-length command-line argument

2012-04-20 Thread Jim Meyering
From: Jim Meyering Given a zero-length directory name, the trailing-slash removal code would test dir_name[-1], and if it were found to be a slash, would set it to '\0'. --- restore.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/restore.c b/restore.c index 250c9

[PATCH 4/4] mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg

2012-04-20 Thread Jim Meyering
From: Jim Meyering * mkfs.c (parse_size): ./mkfs.btrfs -A '' would read and possibly write the byte before beginning of strdup'd heap buffer. All other size-accepting options were similarly affected. --- mkfs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs.c b/mkfs

[PATCH 1/4] mkfs: use strdup in place of strlen,malloc,strcpy sequence

2012-04-20 Thread Jim Meyering
From: Jim Meyering * mkfs.c (traverse_directory): No semantic change. --- mkfs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkfs.c b/mkfs.c index c531ef2..03239fb 100644 --- a/mkfs.c +++ b/mkfs.c @@ -911,8 +911,7 @@ static int traverse_directory(struct btrfs_trans_h

btrfs-utils: minor buffer-overrun fixes

2012-04-20 Thread Jim Meyering
[PATCH 1/4] mkfs: use strdup in place of strlen,malloc,strcpy [PATCH 2/4] restore: don't corrupt stack for a zero-length [PATCH 3/4] avoid strncpy-induced buffer overrun [PATCH 4/4] mkfs: avoid heap-buffer-read-underrun for zero-length The first is just clean-up. The other three fix one sort of co

Ceph on btrfs 3.4rc

2012-04-20 Thread Christian Brunner
After running ceph on XFS for some time, I decided to try btrfs again. Performance with the current "for-linux-min" branch and big metadata is much better. The only problem (?) I'm still seeing is a warning that seems to occur from time to time: [87703.784552] [ cut here ]

send/receive and clone/clone_range ioctls

2012-04-20 Thread Alexander Block
Hello, I'm currently implementing parts of a send/receive tool that walks through all inodes and records changes into a tar/pax archive. Changes are determined by the transid of inodes and the generation number of file extent items. An inode/extent is considered to be changed if the transid/genera

Re: Problems with nodatacow/nodatasum

2012-04-20 Thread Avi Kivity
On Fri, Apr 20, 2012 at 12:12 PM, David Sterba wrote: > On Fri, Apr 20, 2012 at 11:19:39AM +0300, Avi Kivity wrote: >>   /dev/mapper/luks-blah /                       btrfs >> subvol=/rootvol        1 1 >>   /dev/mapper/luks-blah /var/lib/libvirt/images     btrfs >> nodatasum,nodatacow,subvol=/ima

Re: Problems with nodatacow/nodatasum

2012-04-20 Thread David Sterba
On Fri, Apr 20, 2012 at 11:19:39AM +0300, Avi Kivity wrote: > /dev/mapper/luks-blah / btrfs > subvol=/rootvol1 1 > /dev/mapper/luks-blah /var/lib/libvirt/images btrfs > nodatasum,nodatacow,subvol=/images.libvirt1 2 what does /proc/mounts say about the

Problems with nodatacow/nodatasum

2012-04-20 Thread Avi Kivity
I have a btrfs filesystem mounted in two locations as two subvolumes: /dev/mapper/luks-blah / btrfs subvol=/rootvol1 1 /dev/mapper/luks-blah /var/lib/libvirt/images btrfs nodatasum,nodatacow,subvol=/images.libvirt1 2 However, a file under the second

Re: An issue when mounting the dd-copied partition and the original one together

2012-04-20 Thread Jan Schmidt
Hi Chris, On 20.04.2012 09:20, Chris Samuel wrote: > Jan Schmidt was working on a "btrfs send" type command to help with > this, but I've not heard anything recently (last December he posted > that he was distracted by the backref-walking code which was a > necessary precursor for the send/rece

Re: An issue when mounting the dd-copied partition and the original one together

2012-04-20 Thread Chris Samuel
On Friday 20 April 2012 16:49:48 Tydus Ken wrote: > I guess there's something wrong with btrfs in how to deal with two > partition with same UUID or something else, but I'm not sure. I don't believe that btrfs can cope with partitions with the same UID. A pointer here from Auke in July 2011: h