linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: don't ignore errors from btrfs_run_delayed_items
@ 2013-08-05  0:25 Filipe David Borba Manana
  2013-08-05  2:21 ` Miao Xie
  2013-08-05  8:25 ` [PATCH v2] " Filipe David Borba Manana
  0 siblings, 2 replies; 4+ messages in thread
From: Filipe David Borba Manana @ 2013-08-05  0:25 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Filipe David Borba Manana

tree-log.c was ignoring the return value from btrfs_run_delayed_items()
in several places.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---
 fs/btrfs/tree-log.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index ff60d89..f919f26 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -747,7 +747,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
 	ret = btrfs_unlink_inode(trans, root, dir, inode, name, name_len);
 	if (ret)
 		goto out;
-	btrfs_run_delayed_items(trans, root);
+	else
+		ret = btrfs_run_delayed_items(trans, root);
 out:
 	kfree(name);
 	iput(inode);
@@ -923,7 +924,9 @@ again:
 				kfree(victim_name);
 				if (ret)
 					return ret;
-				btrfs_run_delayed_items(trans, root);
+				ret = btrfs_run_delayed_items(trans, root);
+				if (ret)
+					return ret;
 				*search_done = 1;
 				goto again;
 			}
@@ -990,7 +993,8 @@ again:
 								 inode,
 								 victim_name,
 								 victim_name_len);
-					btrfs_run_delayed_items(trans, root);
+					if (!ret)
+						ret = btrfs_run_delayed_items(trans, root);
 				}
 				iput(victim_parent);
 				kfree(victim_name);
@@ -1810,7 +1814,7 @@ again:
 			ret = btrfs_unlink_inode(trans, root, dir, inode,
 						 name, name_len);
 			if (!ret)
-				btrfs_run_delayed_items(trans, root);
+				ret = btrfs_run_delayed_items(trans, root);
 			kfree(name);
 			iput(inode);
 			if (ret)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Btrfs: don't ignore errors from btrfs_run_delayed_items
  2013-08-05  0:25 [PATCH] Btrfs: don't ignore errors from btrfs_run_delayed_items Filipe David Borba Manana
@ 2013-08-05  2:21 ` Miao Xie
  2013-08-05  8:25 ` [PATCH v2] " Filipe David Borba Manana
  1 sibling, 0 replies; 4+ messages in thread
From: Miao Xie @ 2013-08-05  2:21 UTC (permalink / raw)
  To: Filipe David Borba Manana; +Cc: linux-btrfs

On mon, 5 Aug 2013 01:25:26 +0100, Filipe David Borba Manana wrote:
> tree-log.c was ignoring the return value from btrfs_run_delayed_items()
> in several places.
> 
> Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
> ---
>  fs/btrfs/tree-log.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index ff60d89..f919f26 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -747,7 +747,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
>  	ret = btrfs_unlink_inode(trans, root, dir, inode, name, name_len);
>  	if (ret)
>  		goto out;
> -	btrfs_run_delayed_items(trans, root);
> +	else
> +		ret = btrfs_run_delayed_items(trans, root);
>  out:
>  	kfree(name);
>  	iput(inode);
> @@ -923,7 +924,9 @@ again:
>  				kfree(victim_name);
>  				if (ret)
>  					return ret;
> -				btrfs_run_delayed_items(trans, root);
> +				ret = btrfs_run_delayed_items(trans, root);
> +				if (ret)
> +					return ret;
>  				*search_done = 1;
>  				goto again;
>  			}
> @@ -990,7 +993,8 @@ again:
>  								 inode,
>  								 victim_name,
>  								 victim_name_len);
> -					btrfs_run_delayed_items(trans, root);
> +					if (!ret)
> +						ret = btrfs_run_delayed_items(trans, root);

checkpatch.pl reported:

WARNING: line over 80 characters
#141: FILE: fs/btrfs/tree-log.c:997:
+						ret = btrfs_run_delayed_items(trans, root);

The other code is OK.

Thanks
Miao

>  				}
>  				iput(victim_parent);
>  				kfree(victim_name);
> @@ -1810,7 +1814,7 @@ again:
>  			ret = btrfs_unlink_inode(trans, root, dir, inode,
>  						 name, name_len);
>  			if (!ret)
> -				btrfs_run_delayed_items(trans, root);
> +				ret = btrfs_run_delayed_items(trans, root);
>  			kfree(name);
>  			iput(inode);
>  			if (ret)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] Btrfs: don't ignore errors from btrfs_run_delayed_items
  2013-08-05  0:25 [PATCH] Btrfs: don't ignore errors from btrfs_run_delayed_items Filipe David Borba Manana
  2013-08-05  2:21 ` Miao Xie
@ 2013-08-05  8:25 ` Filipe David Borba Manana
  2013-08-05  8:45   ` Miao Xie
  1 sibling, 1 reply; 4+ messages in thread
From: Filipe David Borba Manana @ 2013-08-05  8:25 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Filipe David Borba Manana

tree-log.c was ignoring the return value from btrfs_run_delayed_items()
in several places.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---

V2: Ensure no line exceeds 80 characters.

 fs/btrfs/tree-log.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index ff60d89..f90ae35 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -747,7 +747,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
 	ret = btrfs_unlink_inode(trans, root, dir, inode, name, name_len);
 	if (ret)
 		goto out;
-	btrfs_run_delayed_items(trans, root);
+	else
+		ret = btrfs_run_delayed_items(trans, root);
 out:
 	kfree(name);
 	iput(inode);
@@ -923,7 +924,9 @@ again:
 				kfree(victim_name);
 				if (ret)
 					return ret;
-				btrfs_run_delayed_items(trans, root);
+				ret = btrfs_run_delayed_items(trans, root);
+				if (ret)
+					return ret;
 				*search_done = 1;
 				goto again;
 			}
@@ -990,7 +993,9 @@ again:
 								 inode,
 								 victim_name,
 								 victim_name_len);
-					btrfs_run_delayed_items(trans, root);
+					if (!ret)
+						ret = btrfs_run_delayed_items(
+								  trans, root);
 				}
 				iput(victim_parent);
 				kfree(victim_name);
@@ -1810,7 +1815,7 @@ again:
 			ret = btrfs_unlink_inode(trans, root, dir, inode,
 						 name, name_len);
 			if (!ret)
-				btrfs_run_delayed_items(trans, root);
+				ret = btrfs_run_delayed_items(trans, root);
 			kfree(name);
 			iput(inode);
 			if (ret)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Btrfs: don't ignore errors from btrfs_run_delayed_items
  2013-08-05  8:25 ` [PATCH v2] " Filipe David Borba Manana
@ 2013-08-05  8:45   ` Miao Xie
  0 siblings, 0 replies; 4+ messages in thread
From: Miao Xie @ 2013-08-05  8:45 UTC (permalink / raw)
  To: Filipe David Borba Manana; +Cc: linux-btrfs

On 	mon, 5 Aug 2013 09:25:47 +0100, Filipe David Borba Manana wrote:
> tree-log.c was ignoring the return value from btrfs_run_delayed_items()
> in several places.
> 
> Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
> ---
> 
> V2: Ensure no line exceeds 80 characters.

Looks good to me.

Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>

> 
>  fs/btrfs/tree-log.c |   13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index ff60d89..f90ae35 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -747,7 +747,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
>  	ret = btrfs_unlink_inode(trans, root, dir, inode, name, name_len);
>  	if (ret)
>  		goto out;
> -	btrfs_run_delayed_items(trans, root);
> +	else
> +		ret = btrfs_run_delayed_items(trans, root);
>  out:
>  	kfree(name);
>  	iput(inode);
> @@ -923,7 +924,9 @@ again:
>  				kfree(victim_name);
>  				if (ret)
>  					return ret;
> -				btrfs_run_delayed_items(trans, root);
> +				ret = btrfs_run_delayed_items(trans, root);
> +				if (ret)
> +					return ret;
>  				*search_done = 1;
>  				goto again;
>  			}
> @@ -990,7 +993,9 @@ again:
>  								 inode,
>  								 victim_name,
>  								 victim_name_len);
> -					btrfs_run_delayed_items(trans, root);
> +					if (!ret)
> +						ret = btrfs_run_delayed_items(
> +								  trans, root);
>  				}
>  				iput(victim_parent);
>  				kfree(victim_name);
> @@ -1810,7 +1815,7 @@ again:
>  			ret = btrfs_unlink_inode(trans, root, dir, inode,
>  						 name, name_len);
>  			if (!ret)
> -				btrfs_run_delayed_items(trans, root);
> +				ret = btrfs_run_delayed_items(trans, root);
>  			kfree(name);
>  			iput(inode);
>  			if (ret)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-05  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05  0:25 [PATCH] Btrfs: don't ignore errors from btrfs_run_delayed_items Filipe David Borba Manana
2013-08-05  2:21 ` Miao Xie
2013-08-05  8:25 ` [PATCH v2] " Filipe David Borba Manana
2013-08-05  8:45   ` Miao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).