From: Sun YangKai <sunk67188@gmail.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions
Date: Thu, 21 Aug 2025 18:19:23 +0800 [thread overview]
Message-ID: <1940532.tdWV9SEqCh@saltykitkat> (raw)
In-Reply-To: <202508211534.QmDKCbTm-lkp@intel.com>
> Hi Sun,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:
> https://github.com/intel-lab-lkp/linux/commits/Sun-YangKai/btrfs-more-trivi
> al-BTRFS_PATH_AUTO_FREE-conversions/20250819-114252 base: v6.17-rc2
> patch link:
> https://lore.kernel.org/r/20250819033819.19826-1-sunk67188%40gmail.com
> patch subject: [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions
> config: parisc-randconfig-r071-20250821
> (https://download.01.org/0day-ci/archive/20250821/202508211534.QmDKCbTm-lkp
> @intel.com/config) compiler: hppa-linux-gcc (GCC) 9.5.0
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version
> of the same patch/commit), kindly add following tags
>
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202508211534.QmDKCbTm-lkp@intel.com/
>
> smatch warnings:
> fs/btrfs/send.c:931 get_inode_info() warn: missing error code? 'ret'
>
> vim +/ret +931 fs/btrfs/send.c
>
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 908 static int
> get_inode_info(struct btrfs_root *root, u64 ino, 7e93f6dc11d9128 BingJing
> Chang 2022-08-12 909 struct btrfs_inode_info *info)
31db9f7c23fbf7e
> Alexander Block 2012-07-25 910 {
> 31db9f7c23fbf7e Alexander Block 2012-07-25 911 int ret;
> c8ce1e5fe626333 Sun YangKai 2025-08-19 912
> BTRFS_PATH_AUTO_FREE(path); 31db9f7c23fbf7e Alexander Block 2012-07-25
> 913 struct btrfs_inode_item *ii; 31db9f7c23fbf7e Alexander Block
> 2012-07-25 914 struct btrfs_key key; 31db9f7c23fbf7e Alexander Block
> 2012-07-25 915
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 916 path =
> alloc_path_for_send(); 7e93f6dc11d9128 BingJing Chang 2022-08-12 917
if
> (!path)
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 918 return -ENOMEM;
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 919
> 31db9f7c23fbf7e Alexander Block 2012-07-25 920 key.objectid = ino;
> 31db9f7c23fbf7e Alexander Block 2012-07-25 921 key.type =
> BTRFS_INODE_ITEM_KEY; 31db9f7c23fbf7e Alexander Block 2012-07-25 922
> key.offset = 0;
> 31db9f7c23fbf7e Alexander Block 2012-07-25 923 ret =
> btrfs_search_slot(NULL, root, &key, path, 0, 0); 31db9f7c23fbf7e Alexander
> Block 2012-07-25 924 if (ret) {
> 3f8a18cc53bd1be Josef Bacik 2014-03-28 925 if (ret > 0)
> 31db9f7c23fbf7e Alexander Block 2012-07-25 926 ret = -ENOENT;
> c8ce1e5fe626333 Sun YangKai 2025-08-19 927 return ret;
> 31db9f7c23fbf7e Alexander Block 2012-07-25 928 }
> 31db9f7c23fbf7e Alexander Block 2012-07-25 929
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 930 if (!info)
> c8ce1e5fe626333 Sun YangKai 2025-08-19 @931 return ret;
This early return should be done at the beginning of this function instead of
after btrfs_search_slot() since info is the pointer to the output. With a NULL
output, we should do nothing. I'll change this in patch v2.
>
> ret is zero, but it should be an error code.
>
> 7e93f6dc11d9128 BingJing Chang 2022-08-12 932
> 31db9f7c23fbf7e Alexander Block 2012-07-25 933 ii =
> btrfs_item_ptr(path->nodes[0], path->slots[0], 31db9f7c23fbf7e Alexander
> Block 2012-07-25 934 struct btrfs_inode_item);
7e93f6dc11d9128
> BingJing Chang 2022-08-12 935 info->size =
> btrfs_inode_size(path->nodes[0], ii); 7e93f6dc11d9128 BingJing Chang
> 2022-08-12 936 info->gen = btrfs_inode_generation(path->nodes[0], ii);
Thanks,
Sun Yangkai
next prev parent reply other threads:[~2025-08-21 10:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 3:37 [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions Sun YangKai
2025-08-21 8:21 ` Dan Carpenter
2025-08-21 10:19 ` Sun YangKai [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-09-30 5:09 Sun YangKai
2025-09-30 16:35 ` David Sterba
2025-10-01 13:32 ` Sun YangKai
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=1940532.tdWV9SEqCh@saltykitkat \
--to=sunk67188@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-btrfs@vger.kernel.org \
/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