diff mbox

[1/2] btrfs: returns -ENOMEM if path allocation failed in btrfs_cross_ref_exist()

Message ID 20180530020752.23788-1-suy.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Su Yue May 30, 2018, 2:07 a.m. UTC
Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
---
 fs/btrfs/extent-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Su Yue May 30, 2018, 2:55 a.m. UTC | #1
Sorry, the [PATCH 2/2] is abandoned. So the subject should be [PATCH].


On 05/30/2018 10:07 AM, Su Yue wrote:
> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
> ---
>  fs/btrfs/extent-tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 44093f92a532..99df6199dffc 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3311,7 +3311,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
>  
>  	path = btrfs_alloc_path();
>  	if (!path)
> -		return -ENOENT;
> +		return -ENOMEM;
>  
>  	do {
>  		ret = check_committed_ref(root, path, objectid,
>
Nikolay Borisov May 30, 2018, 6:24 a.m. UTC | #2
On 30.05.2018 05:07, Su Yue wrote:
> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>

Generally we discourage commit log messages. I understand this patch is
very obvious but put a sentence saying that btrfs_alloc_path can fail
due to enomem hence returning enomem is the right ting to do here.
> ---
>  fs/btrfs/extent-tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 44093f92a532..99df6199dffc 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3311,7 +3311,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
>  
>  	path = btrfs_alloc_path();
>  	if (!path)
> -		return -ENOENT;
> +		return -ENOMEM;
>  
>  	do {
>  		ret = check_committed_ref(root, path, objectid,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 44093f92a532..99df6199dffc 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3311,7 +3311,7 @@  int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
 
 	path = btrfs_alloc_path();
 	if (!path)
-		return -ENOENT;
+		return -ENOMEM;
 
 	do {
 		ret = check_committed_ref(root, path, objectid,