Re: [PATCH]] Btrfs: fix destroy snapshot to get the right parent dentry

2009-11-04 Thread Rui Miguel Silva
On Tue, 03 Nov 2009 23:20:02 -, Yan, Zheng yanzh...@21cn.com wrote: On Wed, Nov 4, 2009 at 12:10 AM, Rui Miguel Silva rmf...@gmail.com wrote: In snapshot destroy the dentry used for parent was the snapshot dentry itself. Remove d_invalidate since always return EBUSY, making possible to

[patch 04/10] btrfs: btrfs_sync_file should return -EIO not EIO

2009-11-04 Thread Jeff Mahoney
This patch fixes a typo in the return path of btrfs_sync_file, which currently returns EIO instead of -EIO. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/file.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1223,7 +1223,7 @@

[patch 02/10] btrfs: fix memleak in btrfs_init_new_device

2009-11-04 Thread Jeff Mahoney
If find_next_devid fails, btrfs_init_new_device frees device but not device-name. This patch fixes it. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/volumes.c |1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1474,6 +1474,7 @@ int

[patch 08/10] btrfs: annotate btrfs_{start,join}_transaction failures

2009-11-04 Thread Jeff Mahoney
This patch locates and adds checks for failed transaction joins and starts. It doesn't do anything other than use BTRFS_UERROR to annotate them to keep the patch simple and obvious. The next patch will add handling up the call chain where it's obvious. Signed-off-by: Jeff Mahoney je...@suse.com

[patch 05/10] btrfs: Add BTRFS_UERROR for unhandled errors

2009-11-04 Thread Jeff Mahoney
This patch adds a BTRFS_UERROR macro to indicate than an error is unhandled but should be. This is to differentiate between internal logic errors and runtime errors so that we can go through later more easily to locate and fix them. It currently BUGs after printing a message indicating where

[patch 07/10] btrfs: handle kmalloc call path failures

2009-11-04 Thread Jeff Mahoney
This patch adds checks to ensure that kmalloc or kmem_cache_alloc has succeeded before using the memory. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/compression.c |3 ++- fs/btrfs/disk-io.c |5 - fs/btrfs/extent-tree.c | 28 +++-

[patch 03/10] btrfs: fix btrfs_read_fs_root* return values

2009-11-04 Thread Jeff Mahoney
The btrfs_read_fs_root* functions return ERR_PTR values but the return is being checked for NULL instead. This patch fixes up the checks to use IS_ERR. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/disk-io.c |4 +++- fs/btrfs/extent-tree.c |6 +++--- fs/btrfs/tree-log.c

[patch 00/10] btrfs: Error handling/propagation queue

2009-11-04 Thread Jeff Mahoney
This patch series fixes a few existing problems and then addresses the need for better error handling and propagation in btrfs. The handling and propagation patch set first finds all locations of a particular condition not being checked and annotates them with BTRFS_UERROR to designate that

[patch 06/10] btrfs: annotate kmalloc failures

2009-11-04 Thread Jeff Mahoney
This patch adds checks to ensure that kmalloc or kmem_cache_alloc has succeeded before using the memory. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/compression.c |2 ++ fs/btrfs/ctree.c |1 + fs/btrfs/disk-io.c |1 + fs/btrfs/extent-tree.c | 12 +++-

[patch 09/10] btrfs: handle btrfs_{start,join}_transaction call path failures

2009-11-04 Thread Jeff Mahoney
This patch changes start_transaction() to return an ERR_PTR instead of NULL. Things like I/O errors and allocation failures can be handled differently. Many calls that were previously handled by BTRFS_UERROR are changed to actually pass the error up the tree where appropriate. In cases where the