Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Sun YangKai <sunk67188@gmail.com>
To: wqu@suse.com
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: reorganize error handling in btrfs_tree_mod_log_insert_key
Date: Mon, 29 Sep 2025 16:25:44 +0800	[thread overview]
Message-ID: <2394265.ElGaqSPkdT@saltykitkat> (raw)
In-Reply-To: <eb37da47-2a32-4ff1-9c63-b97a69cc019d@suse.com>

> > -	ret = tree_mod_log_insert(eb->fs_info, tm);
> > -out_unlock:
> > +	/* Deal with allocation error. */
> > +	if (tm)
> > +		ret = tree_mod_log_insert(eb->fs_info, tm);
> 
> Sorry, I don't think this is really that better.
> 
> In fact I'm wondering why we don't delay the allocation after
> tree_mod_dont_log()?

That's what I want to do at first. However, after looking further into 
tree_mod_dont_log(), I found that it trys to get the tree_mod_log_lock. I'm 
not sure if it's better or worse to do the allocation things after getting the 
lock.

> 
> That would be way more straightforward.
> 
> Thanks,
> Qu
> 
> > +	else
> > +		ret = -ENOMEM;
> > +
> > 

Thanks,
Sun YangKai





  reply	other threads:[~2025-09-29  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29  6:56 [PATCH] btrfs: reorganize error handling in btrfs_tree_mod_log_insert_key Sun YangKai
2025-09-29  7:54 ` Qu Wenruo
2025-09-29  8:25   ` Sun YangKai [this message]
2025-09-29  8:32     ` Filipe Manana
2025-09-29  8:43       ` Qu Wenruo
2025-09-29  8:30 ` Filipe Manana
2025-09-29 10:24   ` Sun YangKai
2025-09-29 10:41     ` Filipe Manana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2394265.ElGaqSPkdT@saltykitkat \
    --to=sunk67188@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox