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

2012-04-21 Thread Jim Meyering
[I realized I'd need this v3 as I was falling asleep last night. ] Same net effect as v2, but bisectable, now that the fix - args.name[BTRFS_PATH_NAME_MAX-1] = 0; + args.name[BTRFS_SUBVOL_NAME_MAX-1] = 0; is applied to 3/4, rather than to 4/4. [PATCHv3 1/4] mkfs: use strdup in place

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

2012-04-21 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

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

2012-04-21 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 --- mkfs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

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

2012-04-21 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

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

2012-04-21 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 v4] btrfs: fix early abort in 'remount'

2012-04-21 Thread Sergei Trofimovich
From: Sergei Trofimovich [ Typical case of btrfs rootfs without initramfs: ] When trying to remount 'ro' -> 'rw' filesystem we get early abort from 'btrfs_remount()' due to first unconditional 'goto': > if (fs_info->fs_devices->rw_devices == 0) > ret = -EACCES; > goto restore; /* misind

Accidental use of mkfs.btrfs -L ... recoverable?

2012-04-21 Thread Andreas Nyback
In all haste i accidentally used mkfs.btrfs -L to label a partition with data on it. Is there any way to recover the contents other then something like testdisk to scan the whole drive? brgds Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message

bug?

2012-04-21 Thread Thomas Weber
Hello, today my laptop crashed with the following output. Installed is Archlinux with btrfs on a SSD. Is it btrfs related? Thanks, Thomas Apr 21 13:01:01 localhost anacron[3307]: Anacron started on 2012-04-21 Apr 21 13:01:01 localhost anacron[3307]: Will run job `cron.daily' in 48 min. Apr 21 1

Re: Boot speed/mount time regression with 3.4.0-rc2

2012-04-21 Thread Ahmet Inan
On Fri, Apr 13, 2012 at 3:47 PM, Josef Bacik wrote: > On Fri, Apr 13, 2012 at 02:26:19PM +0200, Ahmet Inan wrote: >> On Fri, Apr 13, 2012 at 1:22 PM, Ahmet Inan >> wrote: >> > On Fri, Apr 13, 2012 at 8:49 AM, cwillu wrote: >> >>> dmesg and fstab attached as requested. >> >> >> >> Need dmesg afte