[PATCH 0/4] btrfs: offline dedupe v1

2013-05-21 Thread Mark Fasheh
Hi, The following series of patches implements in btrfs an ioctl to do offline deduplication of file extents. To be clear, offline in this sense means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software

[PATCH 1/4] btrfs: abtract out range locking in clone ioctl()

2013-05-21 Thread Mark Fasheh
The range locking in btrfs_ioctl_clone is trivially broken out into it's own function. This reduces the complexity of btrfs_ioctl_clone() by a small bit and makes that locking code available to future functions in fs/btrfs/ioctl.c Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c

[PATCH 2/4] btrfs_ioctl_clone: Move clone code into it's own function

2013-05-21 Thread Mark Fasheh
There's some 250+ lines here that are easily encapsulated into their own function. I don't change how anything works here, just create and document the new btrfs_clone() function from btrfs_ioctl_clone() code. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 232

[PATCH 3/4] btrfs: Introduce extent_read_full_page_nolock()

2013-05-21 Thread Mark Fasheh
for extent_read_full_page() to indicate that we are already locked. Partial credit for this patch goes to Gabriel de Perthuis g2p.c...@gmail.com as I have included a fix from him to the original patch which avoids a deadlock on compressed extents. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs

[PATCH 4/4] btrfs: offline dedupe

2013-05-21 Thread Mark Fasheh
along with a length argument. The ioctl will then (for each dedupe) do a byte-by-byte comparison of the user data before deduping the extent. Status and number of bytes deduped are returned for each operation. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 290

Re: [PATCH 4/4] btrfs: offline dedupe

2013-05-24 Thread Mark Fasheh
Hey David, thanks again for the review! Comments are inline below. On Fri, May 24, 2013 at 04:05:36PM +0200, David Sterba wrote: On Tue, May 21, 2013 at 11:28:28AM -0700, Mark Fasheh wrote: +static noinline int fill_data(struct inode *inode, u64 off, u64 len, + char

Re: [PATCH 4/4] btrfs: offline dedupe

2013-05-24 Thread Mark Fasheh
for read, they can check their contents and dedupe them. Letting users dedupe files in say, /etc seems kind of weird to me but I'm struggling to come up with a good explanation of why that should mean we limit this ioctl to root. --Mark -- Mark Fasheh -- To unsubscribe from this list: send

[PATCH 2/4] btrfs_ioctl_clone: Move clone code into it's own function

2013-06-11 Thread Mark Fasheh
There's some 250+ lines here that are easily encapsulated into their own function. I don't change how anything works here, just create and document the new btrfs_clone() function from btrfs_ioctl_clone() code. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 232

[PATCH 4/4] btrfs: offline dedupe

2013-06-11 Thread Mark Fasheh
along with a length argument. The ioctl will then (for each dedupe) do a byte-by-byte comparison of the user data before deduping the extent. Status and number of bytes deduped are returned for each operation. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 329

[PATCH 1/4] btrfs: abtract out range locking in clone ioctl()

2013-06-11 Thread Mark Fasheh
The range locking in btrfs_ioctl_clone is trivially broken out into it's own function. This reduces the complexity of btrfs_ioctl_clone() by a small bit and makes that locking code available to future functions in fs/btrfs/ioctl.c Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c

[PATCH 0/4] btrfs: offline dedupe v2

2013-06-11 Thread Mark Fasheh
Hi, The following series of patches implements in btrfs an ioctl to do offline deduplication of file extents. To be clear, offline in this sense means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software

[PATCH 3/4] btrfs: Introduce extent_read_full_page_nolock()

2013-06-11 Thread Mark Fasheh
for extent_read_full_page() to indicate that we are already locked. Partial credit for this patch goes to Gabriel de Perthuis g2p.c...@gmail.com as I have included a fix from him to the original patch which avoids a deadlock on compressed extents. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs

Re: [PATCH 0/4] btrfs: offline dedupe v2

2013-06-11 Thread Mark Fasheh
? Thanks for the quick reply :) --Mark -- Mark Fasheh -- 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/majordomo-info.html

Re: [PATCH 0/4] btrfs: offline dedupe v2

2013-06-11 Thread Mark Fasheh
On Tue, Jun 11, 2013 at 11:31:41PM +0200, Gabriel de Perthuis wrote: Le 11/06/2013 23:04, Mark Fasheh a écrit : On Tue, Jun 11, 2013 at 10:56:59PM +0200, Gabriel de Perthuis wrote: What I found however is that neither of these is a great idea ;) - We want to require that the inode be open

Re: [PATCH 0/4] btrfs: offline dedupe v2

2013-06-17 Thread Mark Fasheh
On Wed, Jun 12, 2013 at 02:10:37PM -0400, Josef Bacik wrote: On Tue, Jun 11, 2013 at 02:31:34PM -0600, Mark Fasheh wrote: Hi, The following series of patches implements in btrfs an ioctl to do offline deduplication of file extents. Ok I'm relatively happy with this set, I just want

Re: btrfs: stat(2) and /proc/pid/maps returns different devices

2013-07-10 Thread Mark Fasheh
://bugzilla.openvz.org/show_bug.cgi?id=2653 And about 2 years ago Mark Fasheh tried to fix this problem: http://thr3ads.net/btrfs-devel/2011/05/2346176-RFC-PATCH-0-2-btrfs-vfs-Return-same-device-in-stat-2-and-proc-pid-maps And basically nobody cared :/ Eric Biederman sugested to not create a new

Re: btrfs: stat(2) and /proc/pid/maps returns different devices

2013-07-10 Thread Mark Fasheh
On Wed, Jul 10, 2013 at 09:31:05AM -0700, Mark Fasheh wrote: As far as I can tell we'll be carrying this patch until a better solution is possible. When that will happen, I don't know. --Mark Well, what do I get when I pretend I don't care any more? The little voice in my head says

Re: btrfs: stat(2) and /proc/pid/maps returns different devices

2013-07-19 Thread Mark Fasheh
On Thu, Jul 11, 2013 at 12:26:50AM +0200, David Sterba wrote: On Wed, Jul 10, 2013 at 10:45:45AM -0700, Mark Fasheh wrote: Well, what do I get when I pretend I don't care any more? The little voice in my head says keep plugging away. Here's another attempt at fixing this problem in a sane

[PATCH] vfs: allow /proc/PID/maps to get device from stat

2013-07-22 Thread Mark Fasheh
: http://thr3ads.net/btrfs-devel/2011/05/2346176-RFC-PATCH-0-2-btrfs-vfs-Return-same-device-in-stat-2-and-proc-pid-maps Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/super.c| 1 + fs/proc/generic.c | 15 +++ fs/proc/internal.h | 1 + fs/proc/nommu.c

[PATCH 2/4] btrfs_ioctl_clone: Move clone code into it's own function

2013-07-26 Thread Mark Fasheh
There's some 250+ lines here that are easily encapsulated into their own function. I don't change how anything works here, just create and document the new btrfs_clone() function from btrfs_ioctl_clone() code. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 232

[PATCH 1/4] btrfs: abtract out range locking in clone ioctl()

2013-07-26 Thread Mark Fasheh
The range locking in btrfs_ioctl_clone is trivially broken out into it's own function. This reduces the complexity of btrfs_ioctl_clone() by a small bit and makes that locking code available to future functions in fs/btrfs/ioctl.c Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c

[PATCH 0/4] btrfs: offline dedupe v3

2013-07-26 Thread Mark Fasheh
Hi, The following series of patches implements in btrfs an ioctl to do offline deduplication of file extents. To be clear, offline in this sense means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software

[PATCH 4/4] btrfs: offline dedupe

2013-07-26 Thread Mark Fasheh
along with a length argument. The ioctl will then (for each dedupe) do a byte-by-byte comparison of the user data before deduping the extent. Status and number of bytes deduped are returned for each operation. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 283

[PATCH 3/4] btrfs: Introduce extent_read_full_page_nolock()

2013-07-26 Thread Mark Fasheh
for extent_read_full_page() to indicate that we are already locked. Partial credit for this patch goes to Gabriel de Perthuis g2p.c...@gmail.com as I have included a fix from him to the original patch which avoids a deadlock on compressed extents. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs

Re: [PATCH] Btrfs-progs: add dedup subcommand

2013-08-01 Thread Mark Fasheh
of a subcommand of the btrfs binary. --Mark -- Mark Fasheh -- 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/majordomo-info.html

[PATCH 2/4] btrfs_ioctl_clone: Move clone code into it's own function

2013-08-06 Thread Mark Fasheh
There's some 250+ lines here that are easily encapsulated into their own function. I don't change how anything works here, just create and document the new btrfs_clone() function from btrfs_ioctl_clone() code. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 232

[PATCH 0/4] btrfs: out-of-band (aka offline) dedupe v4

2013-08-06 Thread Mark Fasheh
Hi, The following series of patches implements in btrfs an ioctl to do out-of-band deduplication of file extents. To be clear, this means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software initiates a

[PATCH 1/4] btrfs: abtract out range locking in clone ioctl()

2013-08-06 Thread Mark Fasheh
The range locking in btrfs_ioctl_clone is trivially broken out into it's own function. This reduces the complexity of btrfs_ioctl_clone() by a small bit and makes that locking code available to future functions in fs/btrfs/ioctl.c Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c

[PATCH 3/4] btrfs: Introduce extent_read_full_page_nolock()

2013-08-06 Thread Mark Fasheh
for extent_read_full_page() to indicate that we are already locked. Partial credit for this patch goes to Gabriel de Perthuis g2p.c...@gmail.com as I have included a fix from him to the original patch which avoids a deadlock on compressed extents. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs

[PATCH 4/4] btrfs: offline dedupe

2013-08-06 Thread Mark Fasheh
along with a length argument. The ioctl will then (for each dedupe) do a byte-by-byte comparison of the user data before deduping the extent. Status and number of bytes deduped are returned for each operation. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 278

[PATCH][RESEND] vfs: allow /proc/PID/maps to get device from stat

2013-08-07 Thread Mark Fasheh
-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/super.c| 1 + fs/proc/generic.c | 15 +++ fs/proc/internal.h | 1 + fs/proc/nommu.c | 2 +- fs/proc/task_mmu.c | 2 +- fs/proc/task_nommu.c| 2 +- include/uapi/linux/fs.h | 1 + 7 files changed, 21

Re: [PROGS PATCH] Import btrfs-extent-same

2013-08-13 Thread Mark Fasheh
... Sound reasonable? --Mark -- Mark Fasheh -- 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/majordomo-info.html

Re: [PROGS PATCH] Import btrfs-extent-same

2013-09-03 Thread Mark Fasheh
-user perspective. For example, I had to include a note in the files subcommand that it does not require online dedupe to be turned on. Again I think most new end users are going to look at this and be confused. --Mark -- Mark Fasheh From 8285eacdffa9fad783efca0ce0b7979f607e9e24 Mon Sep 17

Re: [PATCH][RESEND] vfs: allow /proc/PID/maps to get device from stat

2013-09-10 Thread Mark Fasheh
that is described above? Sincerely, someone who would like to fix this ABI breakage that has been going on for years. --Mark -- Mark Fasheh -- 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

Re: Build failures due to commit 416161db (btrfs: offline dedupe)

2013-09-13 Thread Mark Fasheh
of the patch were putting the whole struct but during review I was asked to change it. This should be very straight forward to fix so long as we all stay calm ;) --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord

Re: Build failures due to commit 416161db (btrfs: offline dedupe)

2013-09-18 Thread Mark Fasheh
On Wed, Sep 18, 2013 at 11:40:07AM -0700, Guenter Roeck wrote: On Tue, Sep 17, 2013 at 03:43:54PM -0700, Mark Fasheh wrote: On Fri, Sep 13, 2013 at 03:33:34PM -0400, Chris Mason wrote: Mark, could you please send a patch for the whole-struct option until the unaligned put is upstreamed

btrfs device returned from stat vs /proc/pid/maps

2011-03-21 Thread Mark Fasheh
the subvolumes device (via some callback I suppose)? Another alternative of course is to return the true block device in btrfs_getattr() but that has some obvious downsides too. Thanks and best regards, --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line unsubscribe linux

[PATCH] btrfs: return EXDEV when linking from different subvolumes

2011-03-22 Thread Mark Fasheh
points, but link() does not work across different mount points, even if the same file system is mounted on both.) This matters because an application may have different behaviors based on return codes. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c |2 +- 1

Re: very poor read / write performance compared to other FS's?

2011-05-12 Thread Mark Fasheh
with a more recent kernel. --Mark -- Mark Fasheh -- 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/majordomo-info.html

[RFC][PATCH 1/2] vfs: allow /proc/pid/maps to return a custom device

2011-05-13 Thread Mark Fasheh
This patch introduces a callback in the super_operations structure, 'get_maps_dev' which is then used by procfs to query which device to return for reporting in /proc/[PID]/maps. btrfs wants this so that it can return the same device as it uses from stat(2) calls. Signed-off-by: Mark Fasheh mfas

[RFC][PATCH 2/2] Subject: btrfs: Introduce btrfs_get_maps_dev()

2011-05-13 Thread Mark Fasheh
Use this to return the subvolume superblock in proc instead of the global superblock which is automatically taken today. This fixes a userspace breakage where discrepancies between the devices two would confuse software such as lsof. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs

Re: [RFC][PATCH 1/2] vfs: allow /proc/pid/maps to return a custom device

2011-05-19 Thread Mark Fasheh
On Sat, May 14, 2011 at 08:06:04PM -0700, Eric W. Biederman wrote: Mark Fasheh mfas...@suse.com writes: This patch introduces a callback in the super_operations structure, 'get_maps_dev' which is then used by procfs to query which device to return for reporting in /proc/[PID]/maps

Re: [PATCH 1/4] Btrfs: send, bump stream version

2014-04-15 Thread Mark Fasheh
snapshotting tools that are using send/recieve and it would be bad to change the ABI in incompatible ways underneath them. --Mark -- Mark Fasheh -- 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

Re: [PATCH 1/4] Btrfs: send, bump stream version

2014-04-15 Thread Mark Fasheh
or not (this is easiest) I would generally avoid breaking compatibility inside of btrfs-progs too so just forcing the new flag seems the most 'breaking' option. Thanks, --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord

[PATCH 1/3] btrfs-progs: print qgroup excl as unsigned

2014-05-07 Thread Mark Fasheh
It's unsigned in the structure definition. Reviewed-by: Mark Fasheh mfas...@suse.de --- print-tree.c | 12 ++-- qgroup.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/print-tree.c b/print-tree.c index 7263b09..adef94a 100644 --- a/print-tree.c +++ b/print

[PATCH 0/3] btrfs-progs: add quota group verify to btrfsck

2014-05-07 Thread Mark Fasheh
Hi, The following 3 patches add support to btrfsck to check the counts in subvolume quota groups. With these patches a user can run btrfsck against a volume and if quota is enabled, qgroup data will be checked against the actual space used on disk. I also added a --qgroup-report option

[PATCH 2/3] btrfs-progs: import ulist

2014-05-07 Thread Mark Fasheh
qgroup-verify.c wants this for walking root refs. Signed-off-by: Mark Fasheh mfas...@suse.de --- Makefile | 3 +- kerncompat.h | 2 +- ulist.c | 253 +++ ulist.h | 66 4 files changed, 322 insertions

[PATCH 3/3] btrfs-progs: add quota group verify code

2014-05-07 Thread Mark Fasheh
yet. Adding the code to verify compressed counts shouldn't be hard at all though once kernel can do this. - It is only concerned with subvolume quota groups (like most of btrfs-progs). Signed-off-by: Mark Fasheh mfas...@suse.de --- Makefile|2 +- cmds-check.c| 24

Re: send/receive and bedup

2014-05-19 Thread Mark Fasheh
finding code as it got messy and could be a bit faster. --Mark -- Mark Fasheh -- 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/majordomo-info.html

Re: send/receive and bedup

2014-05-19 Thread Mark Fasheh
how much time I've had :) 2) can it be included in btrfs-progs so that it becomes a standard feature of btrfs? I have to think about this one personally as it implies some tradeoffs in my development on duperemove that I'm not sure I want to make yet. --Mark -- Mark Fasheh

Re: send/receive and bedup

2014-05-19 Thread Mark Fasheh
disagree that it might not be as good an idea as it sounds. --Mark -- Mark Fasheh -- 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/majordomo-info.html

Re: send/receive and bedup

2014-05-20 Thread Mark Fasheh
data sets is the type of work I want to be doing on it in the future. --Mark -- Mark Fasheh -- 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/majordomo-info.html

[PATCH] btrfs: Remove BUG_ON's from btrfs_update_root

2011-06-28 Thread Mark Fasheh
. In order to maintain behavior I placed a BUG_ON clause there - at least though it's now at a higher level in the code. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/ioctl.c |1 + fs/btrfs/root-tree.c |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs

[PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors

2011-07-14 Thread Mark Fasheh
, btrfs_lookup_csums_range, btrfs_csum_file_blocks, btrfs_mark_extent_written, btrfs_inode_by_name, btrfs_new_inode, btrfs_symlink, insert_reserved_file_extent, and run_delalloc_nocow Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c | 12 +--- fs/btrfs/file-item.c |7 +-- fs

Re: [PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors

2011-07-14 Thread Mark Fasheh
On Thu, Jul 14, 2011 at 03:00:07PM -0700, Mark Fasheh wrote: This patch fixes many callers of btrfs_alloc_path() which BUG_ON allocation failure. All the sites that are fixed in this patch were checked by me to be fairly trivial to fix because of at least one of two criteria: Please ignore

[PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors

2011-07-14 Thread Mark Fasheh
Hi, The following patches attempt to replace all the paths where we BUG_ON the return value of btrfs_alloc_path with proper error handling. It's pretty clear that these places aren't BUGing because of code error. To be explicit, much of the code is doing something like this: path

[PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors

2011-07-14 Thread Mark Fasheh
, btrfs_lookup_csums_range, btrfs_csum_file_blocks, btrfs_mark_extent_written, btrfs_inode_by_name, btrfs_new_inode, btrfs_symlink, insert_reserved_file_extent, and run_delalloc_nocow Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c | 12 +--- fs/btrfs/file-item.c |7 +-- fs

[PATCH 4/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_read_locked_inode

2011-07-14 Thread Mark Fasheh
btrfs_iget() also needed an update so that errors from btrfs_locked_inode() are caught and bubbled back up. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs

[PATCH 7/7] btrfs: don't BUG_ON allocation errors in btrfs_drop_snapshot

2011-07-14 Thread Mark Fasheh
In addition to properly handling allocation failure from btrfs_alloc_path, I also fixed up the kzalloc error handling code immediately below it. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk

2011-07-14 Thread Mark Fasheh
I also removed the BUG_ON from error return of find_next_chunk in init_first_rw_device(). It turns out that the only caller of init_first_rw_device() also BUGS on any nonzero return so no actual behavior change has occurred here. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/volumes.c

[PATCH 2/7] btrfs: Don't BUG_ON alloc_path errors in replay_one_buffer()

2011-07-14 Thread Mark Fasheh
The two -process_func call sites in tree-log.c which were ignoring a return code have also been updated to gracefully exit as well. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/tree-log.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs

[PATCH 3/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_truncate_inode_items

2011-07-14 Thread Mark Fasheh
I moved the path allocation up a few lines to the top of the function so that we couldn't get into the state where we've dropped delayed items and the extent cache but fail due to -ENOMEM. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c |9 + 1 files changed, 5

Re: [PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk

2011-07-18 Thread Mark Fasheh
don't think so actually. It looks like in this case we might want to bubble the error back up past do_chunk_alloc and leave space_info untouched. Chris, does that seem reasonable? --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body

Re: [PATCH 7/7] btrfs: don't BUG_ON allocation errors in btrfs_drop_snapshot

2011-07-18 Thread Mark Fasheh
On Fri, Jul 15, 2011 at 12:04:46PM +0900, Tsutomu Itoh wrote: (2011/07/15 7:15), Mark Fasheh wrote: In addition to properly handling allocation failure from btrfs_alloc_path, I also fixed up the kzalloc error handling code immediately below it. Need not you correct the caller

[PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors v2

2011-07-21 Thread Mark Fasheh
Changelog: - Updated patch 6 after review from Tsutomu Itoh Hi, The following patches attempt to replace all the paths where we BUG_ON the return value of btrfs_alloc_path with proper error handling. It's pretty clear that these places aren't BUGing because of code error. To be

[PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors

2011-07-21 Thread Mark Fasheh
, btrfs_lookup_csums_range, btrfs_csum_file_blocks, btrfs_mark_extent_written, btrfs_inode_by_name, btrfs_new_inode, btrfs_symlink, insert_reserved_file_extent, and run_delalloc_nocow Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c | 12 +--- fs/btrfs/file-item.c |7 +-- fs

[PATCH 2/7] btrfs: Don't BUG_ON alloc_path errors in replay_one_buffer()

2011-07-21 Thread Mark Fasheh
The two -process_func call sites in tree-log.c which were ignoring a return code have also been updated to gracefully exit as well. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/tree-log.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs

[PATCH 3/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_truncate_inode_items

2011-07-21 Thread Mark Fasheh
I moved the path allocation up a few lines to the top of the function so that we couldn't get into the state where we've dropped delayed items and the extent cache but fail due to -ENOMEM. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c |9 + 1 files changed, 5

[PATCH 7/7] btrfs: don't BUG_ON allocation errors in btrfs_drop_snapshot

2011-07-21 Thread Mark Fasheh
In addition to properly handling allocation failure from btrfs_alloc_path, I also fixed up the kzalloc error handling code immediately below it. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH 5/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_balance()

2011-07-21 Thread Mark Fasheh
). Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/volumes.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 19450bc..530a2fc 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2061,8 +2061,10 @@ int

[PATCH 4/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_read_locked_inode

2011-07-21 Thread Mark Fasheh
btrfs_iget() also needed an update so that errors from btrfs_locked_inode() are caught and bubbled back up. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs

[PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk

2011-07-21 Thread Mark Fasheh
btrfs_alloc_chunk() which can now return -ENOMEM. Instead of setting space_info-full on any error from btrfs_alloc_chunk() I catch and return every error value _except_ -ENOSPC. Thanks goes to Tsutomu Itoh for pointing that issue out. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/extent-tree.c

Re: [PATCH 7/7] btrfs: don't BUG_ON allocation errors in btrfs_drop_snapshot

2011-07-25 Thread Mark Fasheh
On Fri, Jul 22, 2011 at 09:45:19AM +0900, Tsutomu Itoh wrote: (2011/07/22 4:48), Mark Fasheh wrote: In addition to properly handling allocation failure from btrfs_alloc_path, I also fixed up the kzalloc error handling code immediately below it. Signed-off-by: Mark Fasheh mfas...@suse.com

Re: [PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk

2011-07-25 Thread Mark Fasheh
, extent_root, flags); + if (ret 0 ret != -ENOSPC) + return ret; + You need mutex_unlock() before return. Of course... Here's an updated patch (git tree has also been updated). Thanks, --Mark -- Mark Fasheh From: Mark Fasheh mfas...@suse.com [PATCH] btrfs: Don't

[PATCH] btrfs: Handle NULL inode return from btrfs_lookup_dentry()

2011-08-05 Thread Mark Fasheh
pretty high up the call path at this point. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/ioctl.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7cf0133..fc9525f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c

[PATCH] btrfs: Don't BUG_ON errors from btrfs_create_subvol_root()

2011-08-05 Thread Mark Fasheh
errors we can bubble this one up too. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/inode.c |3 +-- fs/btrfs/ioctl.c |2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 15fceef..7028c0c 100644 --- a/fs/btrfs/inode.c +++ b

[PATCH] btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()

2011-08-08 Thread Mark Fasheh
and verifying that when this hits (git clone seemed to exercise this), the function throws the proper error. Unfortunately but predictably, we later hit a BUG_ON(ret) type line that still hasn't been fixed up ;) Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/file-item.c | 15

[PATCH] btrfs: make insert_ptr() void

2011-08-08 Thread Mark Fasheh
insert_ptr() always returns zero, so all the exta error handling can go away. This makes it trivial to also make copy_for_split() a void function as it's only return was from insert_ptr(). Finally, this all makes the BUG_ON(ret) in split_leaf() meaningless so I removed that. Signed-off-by: Mark

[PATCH 0/8] btrfs: Error handling fixes

2011-08-18 Thread Mark Fasheh
Hi, The following are assorted fixes to error handling from all parts of the Btrfs code. Every patch in this series stands on it's own, with the exception of the last patch which relies on the one before it (so patches 7 and 8 can be considered a pair). I also included in this series an

[PATCH 1/8] btrfs: Don't BUG_ON errors from btrfs_create_subvol_root()

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com This is called from only one place - create_subvol() which passes errors safely back out to it's caller, btrfs_mksubvol where they are handled. Additionally, btrfs_create_subvol_root() itself bug's needlessly from error return of btrfs_update_inode(). Since

[PATCH 2/8] btrfs: Don't BUG_ON() errors in update_ref_for_cow()

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com The only caller of update_ref_for_cow() is __btrfs_cow_block() which was originally ignoring any return values. update_ref_for_cow() however doesn't look like a candidate to become a void function - there are a few places where errors can occur. So instead I

[PATCH 3/8] btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com Unfortunately it isn't enough to just exit here - the kzalloc() happens in a loop and the allocated items are added to a linked list whose head is passed in from the caller. To fix the BUG_ON() and also provide the semantic that the list passed in is only

[PATCH 4/8] btrfs: make insert_ptr() void

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com insert_ptr() always returns zero, so all the exta error handling can go away. This makes it trivial to also make copy_for_split() a void function as it's only return was from insert_ptr(). Finally, this all makes the BUG_ON(ret) in split_leaf() meaningless so I

[PATCH 6/8] btrfs: fix error check of btrfs_lookup_dentry()

2011-08-18 Thread Mark Fasheh
...@jp.fujitsu.com Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/inode.c | 12 ++-- fs/btrfs/ioctl.c | 11 +-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7028c0c..9f3a85d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs

[PATCH 7/8] btrfs: make fixup_low_keys() void

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com This is trivial - fixup_low_keys always returns zero so we can make it void. As a result, we can then make setup_items_for_insert() void too which lets us cut out a couple of BUG_ON(ret) lines. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ctree.c

[PATCH 5/8] btrfs: Don't BUG_ON errors in __finish_chunk_alloc()

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com All callers of __finish_chunk_alloc() BUG_ON() return value, so it's trivial for us to always bubble up any errors caught in __finish_chunk_alloc() to be caught there. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/volumes.c |7 ++- 1 files

[PATCH 8/8] btrfs: make del_ptr() and btrfs_del_leaf() void

2011-08-18 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com Since fixup_low_keys() has been made void, del_ptr() always returns zero. We can then make it void as well. This allows us in turn to make btrfs_del_leaf() void as the only return value it was previously catching was from del_ptr(). This winds up removing

[PATCH 0/20] btrfs: More error handling fixes

2011-09-15 Thread Mark Fasheh
of bubbling errors up the stack. The patches were tested using some simple file system commands and a background kernel build. Please review, all constructive feedback is appreciated :) Thanks, --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body

[PATCH 01/20] btrfs: Don't BUG_ON errors from btrfs_create_subvol_root()

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com This is called from only one place - create_subvol() which passes errors safely back out to it's caller, btrfs_mksubvol where they are handled. Additionally, btrfs_create_subvol_root() itself bug's needlessly from error return of btrfs_update_inode(). Since

[PATCH 04/20] btrfs: make insert_ptr() void

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com insert_ptr() always returns zero, so all the exta error handling can go away. This makes it trivial to also make copy_for_split() a void function as it's only return was from insert_ptr(). Finally, this all makes the BUG_ON(ret) in split_leaf() meaningless so I

[PATCH 02/20] btrfs: Don't BUG_ON() errors in update_ref_for_cow()

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com The only caller of update_ref_for_cow() is __btrfs_cow_block() which was originally ignoring any return values. update_ref_for_cow() however doesn't look like a candidate to become a void function - there are a few places where errors can occur. So instead I

[PATCH 06/20] btrfs: fix error check of btrfs_lookup_dentry()

2011-09-15 Thread Mark Fasheh
...@jp.fujitsu.com Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/inode.c | 12 ++-- fs/btrfs/ioctl.c | 11 +-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 15fceef..5fdb700 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs

[PATCH 08/20] btrfs: make del_ptr() and btrfs_del_leaf() void

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com Since fixup_low_keys() has been made void, del_ptr() always returns zero. We can then make it void as well. This allows us in turn to make btrfs_del_leaf() void as the only return value it was previously catching was from del_ptr(). This winds up removing

[PATCH 10/20] btrfs: go readonly on insert error in btrfs_add_root_ref()

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com In btrfs_add_root_ref() we BUG if an error is encountered during REF/BACKREF insertion. This does not look like a logic error, thus the BUG is not called for. However, I don't think there's a simple way to recover from such an error at that point, so we mark

[PATCH 14/20] btrfs: Document BUG() in find_lock_delalloc_range()

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com We BUG_ON a nonzero, non -EAGAIN ret from lock_delalloc_range(). As it turns out there is no other possible return value that makes sense anyway. The bare BUG_ON(ret) was a bit confusing and looked like something that needed fixing. This patch documents

[PATCH 15/20] btrfs: Go readonly on missing ref in btrfs_get_parent()

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com btrfs_get_parent() searches the btree for a ref to the current object. From there it can compute the parent objectid from which it can return a dentry. if the reference is not found in the tree however, we BUG(). I believe a more appropriate response would

[PATCH 18/20] btrfs: Don't BUG_ON insert errors in btrfs_alloc_dev_extent()

2011-09-15 Thread Mark Fasheh
The only caller of btrfs_alloc_dev_extent() is __btrfs_alloc_chunk() which already bugs on any error returned. We can remove the BUG_ON's in btrfs_alloc_dev_extent() then since __btrfs_alloc_chunk() will catch them anyway. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/volumes.c |4

[PATCH 20/20] btrfs: Remove BUG_ON from __finish_chunk_alloc()

2011-09-15 Thread Mark Fasheh
btrfs_alloc_chunk() unconditionally BUGs on any error returned from __finish_chunk_alloc() so there's no need for two BUG_ON lines. Remove the one from __finish_chunk_alloc(). Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/volumes.c |4 +++- 1 files changed, 3 insertions(+), 1

[PATCH 16/20] btrfs: make add_delayed_ref_head() void

2011-09-15 Thread Mark Fasheh
From: Mark Fasheh mfas...@suse.com This is trivial as the function always returns success. We can remove 3 BUG_ON(ret) lines as a result. Signed-off-by: Mark Fasheh mfas...@suse.com --- fs/btrfs/delayed-ref.c | 26 ++ 1 files changed, 10 insertions(+), 16 deletions

[PATCH 19/20] btrfs: Remove BUG_ON from __btrfs_alloc_chunk()

2011-09-15 Thread Mark Fasheh
We BUG_ON() error from add_extent_mapping(), but that error looks pretty easy to bubble back up - as far as I can tell there have not been any permanent modifications to fs state at that point. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/volumes.c |3 ++- 1 files changed, 2

  1   2   3   4   5   >