public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode
@ 2023-02-18  4:36 void0red
  2023-02-18  4:41 ` Qu Wenruo
  2023-02-20 20:02 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: void0red @ 2023-02-18  4:36 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs, linux-kernel, void0red

Even if the slot is already read out, we may still need to re-balance
the tree, thus it can cause error in that btrfs_del_item() call.

Link: https://lore.kernel.org/linux-btrfs/9b45f60f-c849-e072-64ef-298937e6a8a3@suse.com/T/#t

Signed-off-by: void0red <void0red@gmail.com>
---
 fs/btrfs/delayed-inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index cac5169eaf8d..88a5d893972d 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1043,7 +1043,7 @@ static int __btrfs_update_delayed_inode(struct btrfs_trans_handle *trans,
 	 * so there is only one iref. The case that several irefs are
 	 * in the same item doesn't exist.
 	 */
-	btrfs_del_item(trans, root, path);
+	ret = btrfs_del_item(trans, root, path);
 out:
 	btrfs_release_delayed_iref(node);
 	btrfs_release_path(path);
-- 
2.34.1


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

* Re: [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode
  2023-02-18  4:36 [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode void0red
@ 2023-02-18  4:41 ` Qu Wenruo
  2023-02-20 20:02 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2023-02-18  4:41 UTC (permalink / raw)
  To: void0red, dsterba; +Cc: linux-btrfs, linux-kernel



On 2023/2/18 12:36, void0red wrote:
> Even if the slot is already read out, we may still need to re-balance
> the tree, thus it can cause error in that btrfs_del_item() call.
> 
> Link: https://lore.kernel.org/linux-btrfs/9b45f60f-c849-e072-64ef-298937e6a8a3@suse.com/T/#t
> 
> Signed-off-by: void0red <void0red@gmail.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/delayed-inode.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
> index cac5169eaf8d..88a5d893972d 100644
> --- a/fs/btrfs/delayed-inode.c
> +++ b/fs/btrfs/delayed-inode.c
> @@ -1043,7 +1043,7 @@ static int __btrfs_update_delayed_inode(struct btrfs_trans_handle *trans,
>   	 * so there is only one iref. The case that several irefs are
>   	 * in the same item doesn't exist.
>   	 */
> -	btrfs_del_item(trans, root, path);
> +	ret = btrfs_del_item(trans, root, path);
>   out:
>   	btrfs_release_delayed_iref(node);
>   	btrfs_release_path(path);

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

* Re: [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode
  2023-02-18  4:36 [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode void0red
  2023-02-18  4:41 ` Qu Wenruo
@ 2023-02-20 20:02 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2023-02-20 20:02 UTC (permalink / raw)
  To: void0red; +Cc: dsterba, linux-btrfs, linux-kernel

On Sat, Feb 18, 2023 at 12:36:48PM +0800, void0red wrote:
> Even if the slot is already read out, we may still need to re-balance
> the tree, thus it can cause error in that btrfs_del_item() call.
> 
> Link: https://lore.kernel.org/linux-btrfs/9b45f60f-c849-e072-64ef-298937e6a8a3@suse.com/T/#t
> 
> Signed-off-by: void0red <void0red@gmail.com>

Added to misc-next, thanks.

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

end of thread, other threads:[~2023-02-20 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18  4:36 [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode void0red
2023-02-18  4:41 ` Qu Wenruo
2023-02-20 20:02 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox