From: kernel test robot <lkp@intel.com>
To: Boris Burkov <boris@bur.io>,
linux-btrfs@vger.kernel.org, linux-fscrypt@vger.kernel.org,
kernel-team@fb.com
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH v5 2/3] btrfs: initial fsverity support
Date: Fri, 25 Jun 2021 12:50:48 +0800 [thread overview]
Message-ID: <202106251208.37oQzKiW-lkp@intel.com> (raw)
In-Reply-To: <459e0acf996441628bc465bbe64218d7fea132c4.1624573983.git.boris@bur.io>
[-- Attachment #1: Type: text/plain, Size: 4948 bytes --]
Hi Boris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20210624]
[cannot apply to v5.13-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Boris-Burkov/btrfs-support-fsverity/20210625-064209
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: x86_64-randconfig-a006-20210622 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/24749321fc3abc183fb4ed2c9ac21e556523fc55
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Boris-Burkov/btrfs-support-fsverity/20210625-064209
git checkout 24749321fc3abc183fb4ed2c9ac21e556523fc55
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/btrfs/verity.c:217:6: warning: variable 'copied' set but not used [-Wunused-but-set-variable]
u64 copied = 0;
^
fs/btrfs/verity.c:536:21: warning: unused variable 'root' [-Wunused-variable]
struct btrfs_root *root = inode->root;
^
fs/btrfs/verity.c:552:24: warning: variable 'trans' is uninitialized when used here [-Wuninitialized]
btrfs_end_transaction(trans);
^~~~~
fs/btrfs/verity.c:537:34: note: initialize the variable 'trans' to silence this warning
struct btrfs_trans_handle *trans;
^
= NULL
3 warnings generated.
vim +/copied +217 fs/btrfs/verity.c
191
192
193 /*
194 * Insert and write inode items with a given key type and offset.
195 *
196 * @inode: The inode to insert for.
197 * @key_type: The key type to insert.
198 * @offset: The item offset to insert at.
199 * @src: Source data to write.
200 * @len: Length of source data to write.
201 *
202 * Write len bytes from src into items of up to 1k length.
203 * The inserted items will have key <ino, key_type, offset + off> where
204 * off is consecutively increasing from 0 up to the last item ending at
205 * offset + len.
206 *
207 * Returns 0 on success and a negative error code on failure.
208 */
209 static int write_key_bytes(struct btrfs_inode *inode, u8 key_type, u64 offset,
210 const char *src, u64 len)
211 {
212 struct btrfs_trans_handle *trans;
213 struct btrfs_path *path;
214 struct btrfs_root *root = inode->root;
215 struct extent_buffer *leaf;
216 struct btrfs_key key;
> 217 u64 copied = 0;
218 unsigned long copy_bytes;
219 unsigned long src_offset = 0;
220 void *data;
221 int ret;
222
223 path = btrfs_alloc_path();
224 if (!path)
225 return -ENOMEM;
226
227 while (len > 0) {
228 /*
229 * 1 for the new item being inserted
230 */
231 trans = btrfs_start_transaction(root, 1);
232 if (IS_ERR(trans)) {
233 ret = PTR_ERR(trans);
234 break;
235 }
236
237 key.objectid = btrfs_ino(inode);
238 key.type = key_type;
239 key.offset = offset;
240
241 /*
242 * Insert 2K at a time mostly to be friendly for smaller
243 * leaf size filesystems
244 */
245 copy_bytes = min_t(u64, len, 2048);
246
247 ret = btrfs_insert_empty_item(trans, root, path, &key, copy_bytes);
248 if (ret) {
249 btrfs_end_transaction(trans);
250 break;
251 }
252
253 leaf = path->nodes[0];
254
255 data = btrfs_item_ptr(leaf, path->slots[0], void);
256 write_extent_buffer(leaf, src + src_offset,
257 (unsigned long)data, copy_bytes);
258 offset += copy_bytes;
259 src_offset += copy_bytes;
260 len -= copy_bytes;
261 copied += copy_bytes;
262
263 btrfs_release_path(path);
264 btrfs_end_transaction(trans);
265 }
266
267 btrfs_free_path(path);
268 return ret;
269 }
270
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47815 bytes --]
next prev parent reply other threads:[~2021-06-25 4:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 22:41 [PATCH v5 0/3] btrfs: support fsverity Boris Burkov
2021-06-24 22:41 ` [PATCH v5 1/3] btrfs: add ro compat flags to inodes Boris Burkov
2021-06-24 22:41 ` [PATCH v5 2/3] btrfs: initial fsverity support Boris Burkov
2021-06-25 4:50 ` kernel test robot [this message]
2021-06-28 8:23 ` Dan Carpenter
2021-06-30 19:42 ` Boris Burkov
2021-06-24 22:41 ` [PATCH v5 3/3] btrfs: verity metadata orphan items Boris Burkov
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=202106251208.37oQzKiW-lkp@intel.com \
--to=lkp@intel.com \
--cc=boris@bur.io \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fscrypt@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