[PATCH] rework btrfs fiemap (please review)

2011-02-21 Thread Chris Mason
Hi everyone, Looks like the latest versions of cp use fiemap to decide if a file is sparse, which is a great way to avoid doing memcmp, but only if your fiemap is really accurate about which ranges in the file have holes. Our fiemap tends to return holes for delalloc bytes, and has a few other bu

Re: [PATCH] Check for immutable flag in fallocate path

2011-02-21 Thread Marco Stornelli
2011/2/21 Christoph Hellwig : > On Mon, Feb 21, 2011 at 09:26:32AM +0100, Marco Stornelli wrote: >> From: Marco Stornelli >> >> All fs must check for the immutable flag in their fallocate callback. >> It's possible to have a race condition in this scenario: an application >> open a file in read/wr

Re: [Bugme-new] [Bug 29302] New: Null pointer dereference with large max_sectors_kb

2011-02-21 Thread Chris Mason
Excerpts from Tomas Zvala's message of 2011-02-20 06:06:42 -0500: > On 18.2.2011 21:18, Chris Mason wrote: > > Ok, so it isn't part of the open devices code that prints errors, my > > guess is we're failing to read a good super. > > > > Could you please mkfs.btrfs /dev/xxx, sync, then btrfsck /dev/

Re: [PATCH] Btrfs: Batched discard support for btrfs

2011-02-21 Thread Josef Bacik
On Mon, Feb 21, 2011 at 04:52:27PM +0800, Li Dongyang wrote: > Here is batched discard support for btrfs, several changes were made: > > btrfs_test_opt(root, DISCARD) is moved from btrfs_discard_extent > to callers, as we still want to trim the fs even it's not mounted > with -o discard. > btrfs_d

Re: [PATCH] Btrfs: Batched discard support for btrfs

2011-02-21 Thread Chris Mason
Excerpts from Li Dongyang's message of 2011-02-21 03:52:27 -0500: > Here is batched discard support for btrfs, several changes were made: > > btrfs_test_opt(root, DISCARD) is moved from btrfs_discard_extent > to callers, as we still want to trim the fs even it's not mounted > with -o discard. > bt

Re: [PATCH] Btrfs: Batched discard support for btrfs

2011-02-21 Thread Lukas Czerner
On Mon, 21 Feb 2011, Li Dongyang wrote: > Here is batched discard support for btrfs, several changes were made: > > btrfs_test_opt(root, DISCARD) is moved from btrfs_discard_extent > to callers, as we still want to trim the fs even it's not mounted > with -o discard. > btrfs_discard_extent now re

Re: [PATCH] Check for immutable flag in fallocate path

2011-02-21 Thread Christoph Hellwig
On Mon, Feb 21, 2011 at 09:26:32AM +0100, Marco Stornelli wrote: > From: Marco Stornelli > > All fs must check for the immutable flag in their fallocate callback. > It's possible to have a race condition in this scenario: an application > open a file in read/write and it does something, meanwhile

Re: [PATCH] Btrfs: Batched discard support for btrfs

2011-02-21 Thread David Sterba
On Mon, Feb 21, 2011 at 04:52:27PM +0800, Li Dongyang wrote: > Here is batched discard support for btrfs, several changes were made: > > btrfs_test_opt(root, DISCARD) is moved from btrfs_discard_extent > to callers, as we still want to trim the fs even it's not mounted > with -o discard. > btrfs_d

[PATCH] Btrfs: Batched discard support for btrfs

2011-02-21 Thread Li Dongyang
Here is batched discard support for btrfs, several changes were made: btrfs_test_opt(root, DISCARD) is moved from btrfs_discard_extent to callers, as we still want to trim the fs even it's not mounted with -o discard. btrfs_discard_extent now reports errors and actual bytes trimmed to callers, for

[PATCH] Check for immutable flag in fallocate path

2011-02-21 Thread Marco Stornelli
From: Marco Stornelli All fs must check for the immutable flag in their fallocate callback. It's possible to have a race condition in this scenario: an application open a file in read/write and it does something, meanwhile root set the immutable flag on the file, the application at that point can