From: kernel test robot <lkp@intel.com>
To: Boris Burkov <boris@bur.io>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com,
linux-fscrypt@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH v3 2/5] btrfs: initial fsverity support
Date: Fri, 9 Apr 2021 06:56:38 +0800 [thread overview]
Message-ID: <202104090627.SB8Sxzkn-lkp@intel.com> (raw)
In-Reply-To: <c9335d862ee4ddc1f7193bbb06ca7313d9ff1b30.1617900170.git.boris@bur.io>
[-- Attachment #1: Type: text/plain, Size: 4534 bytes --]
Hi Boris,
I love your patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20210408]
[cannot apply to v5.12-rc6]
[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/20210409-023606
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: arm64-randconfig-r021-20210408 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 56ea2e2fdd691136d5e6631fa0e447173694b82c)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/dd118218fea47389631a62ec533207ba39e69b41
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Boris-Burkov/btrfs-support-fsverity/20210409-023606
git checkout dd118218fea47389631a62ec533207ba39e69b41
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
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:432:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (desc != NULL) {
^~~~~~~~~~~~
fs/btrfs/verity.c:468:9: note: uninitialized use occurs here
return ret;
^~~
fs/btrfs/verity.c:432:2: note: remove the 'if' if its condition is always true
if (desc != NULL) {
^~~~~~~~~~~~~~~~~~
fs/btrfs/verity.c:430:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +432 fs/btrfs/verity.c
415
416 /*
417 * fsverity op that ends enabling verity.
418 * fsverity calls this when it's done with all of the pages in the file
419 * and all of the merkle items have been inserted. We write the
420 * descriptor and update the inode in the btree to reflect its new life
421 * as a verity file.
422 */
423 static int btrfs_end_enable_verity(struct file *filp, const void *desc,
424 size_t desc_size, u64 merkle_tree_size)
425 {
426 struct btrfs_trans_handle *trans;
427 struct inode *inode = file_inode(filp);
428 struct btrfs_root *root = BTRFS_I(inode)->root;
429 struct btrfs_verity_descriptor_item item;
430 int ret;
431
> 432 if (desc != NULL) {
433 /* write out the descriptor item */
434 memset(&item, 0, sizeof(item));
435 btrfs_set_stack_verity_descriptor_size(&item, desc_size);
436 ret = write_key_bytes(BTRFS_I(inode),
437 BTRFS_VERITY_DESC_ITEM_KEY, 0,
438 (const char *)&item, sizeof(item));
439 if (ret)
440 goto out;
441 /* write out the descriptor itself */
442 ret = write_key_bytes(BTRFS_I(inode),
443 BTRFS_VERITY_DESC_ITEM_KEY, 1,
444 desc, desc_size);
445 if (ret)
446 goto out;
447
448 /* update our inode flags to include fs verity */
449 trans = btrfs_start_transaction(root, 1);
450 if (IS_ERR(trans)) {
451 ret = PTR_ERR(trans);
452 goto out;
453 }
454 BTRFS_I(inode)->compat_flags |= BTRFS_INODE_VERITY;
455 btrfs_sync_inode_flags_to_i_flags(inode);
456 ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
457 btrfs_end_transaction(trans);
458 }
459
460 out:
461 if (desc == NULL || ret) {
462 /* If we failed, drop all the verity items */
463 drop_verity_items(BTRFS_I(inode), BTRFS_VERITY_DESC_ITEM_KEY);
464 drop_verity_items(BTRFS_I(inode), BTRFS_VERITY_MERKLE_ITEM_KEY);
465 } else
466 btrfs_set_fs_compat_ro(root->fs_info, VERITY);
467 clear_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &BTRFS_I(inode)->runtime_flags);
468 return ret;
469 }
470
---
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: 45592 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3 2/5] btrfs: initial fsverity support
Date: Fri, 09 Apr 2021 06:56:38 +0800 [thread overview]
Message-ID: <202104090627.SB8Sxzkn-lkp@intel.com> (raw)
In-Reply-To: <c9335d862ee4ddc1f7193bbb06ca7313d9ff1b30.1617900170.git.boris@bur.io>
[-- Attachment #1: Type: text/plain, Size: 4646 bytes --]
Hi Boris,
I love your patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20210408]
[cannot apply to v5.12-rc6]
[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/20210409-023606
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: arm64-randconfig-r021-20210408 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 56ea2e2fdd691136d5e6631fa0e447173694b82c)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/dd118218fea47389631a62ec533207ba39e69b41
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Boris-Burkov/btrfs-support-fsverity/20210409-023606
git checkout dd118218fea47389631a62ec533207ba39e69b41
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
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:432:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (desc != NULL) {
^~~~~~~~~~~~
fs/btrfs/verity.c:468:9: note: uninitialized use occurs here
return ret;
^~~
fs/btrfs/verity.c:432:2: note: remove the 'if' if its condition is always true
if (desc != NULL) {
^~~~~~~~~~~~~~~~~~
fs/btrfs/verity.c:430:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +432 fs/btrfs/verity.c
415
416 /*
417 * fsverity op that ends enabling verity.
418 * fsverity calls this when it's done with all of the pages in the file
419 * and all of the merkle items have been inserted. We write the
420 * descriptor and update the inode in the btree to reflect its new life
421 * as a verity file.
422 */
423 static int btrfs_end_enable_verity(struct file *filp, const void *desc,
424 size_t desc_size, u64 merkle_tree_size)
425 {
426 struct btrfs_trans_handle *trans;
427 struct inode *inode = file_inode(filp);
428 struct btrfs_root *root = BTRFS_I(inode)->root;
429 struct btrfs_verity_descriptor_item item;
430 int ret;
431
> 432 if (desc != NULL) {
433 /* write out the descriptor item */
434 memset(&item, 0, sizeof(item));
435 btrfs_set_stack_verity_descriptor_size(&item, desc_size);
436 ret = write_key_bytes(BTRFS_I(inode),
437 BTRFS_VERITY_DESC_ITEM_KEY, 0,
438 (const char *)&item, sizeof(item));
439 if (ret)
440 goto out;
441 /* write out the descriptor itself */
442 ret = write_key_bytes(BTRFS_I(inode),
443 BTRFS_VERITY_DESC_ITEM_KEY, 1,
444 desc, desc_size);
445 if (ret)
446 goto out;
447
448 /* update our inode flags to include fs verity */
449 trans = btrfs_start_transaction(root, 1);
450 if (IS_ERR(trans)) {
451 ret = PTR_ERR(trans);
452 goto out;
453 }
454 BTRFS_I(inode)->compat_flags |= BTRFS_INODE_VERITY;
455 btrfs_sync_inode_flags_to_i_flags(inode);
456 ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
457 btrfs_end_transaction(trans);
458 }
459
460 out:
461 if (desc == NULL || ret) {
462 /* If we failed, drop all the verity items */
463 drop_verity_items(BTRFS_I(inode), BTRFS_VERITY_DESC_ITEM_KEY);
464 drop_verity_items(BTRFS_I(inode), BTRFS_VERITY_MERKLE_ITEM_KEY);
465 } else
466 btrfs_set_fs_compat_ro(root->fs_info, VERITY);
467 clear_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &BTRFS_I(inode)->runtime_flags);
468 return ret;
469 }
470
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45592 bytes --]
next prev parent reply other threads:[~2021-04-08 22:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 18:33 [PATCH v3 0/5] btrfs: support fsverity Boris Burkov
2021-04-08 18:33 ` [PATCH v3 1/5] btrfs: add compat_flags to btrfs_inode_item Boris Burkov
2021-04-08 23:40 ` Anand Jain
2021-04-09 18:20 ` Boris Burkov
2021-05-13 17:21 ` David Sterba
2021-04-08 18:33 ` [PATCH v3 2/5] btrfs: initial fsverity support Boris Burkov
2021-04-08 22:38 ` kernel test robot
2021-04-08 22:38 ` kernel test robot
2021-04-08 22:50 ` Eric Biggers
2021-04-09 18:05 ` Boris Burkov
2021-04-09 23:25 ` Eric Biggers
2021-04-09 22:45 ` Boris Burkov
2021-04-09 23:32 ` Eric Biggers
2021-05-03 18:46 ` Boris Burkov
2021-04-08 22:56 ` kernel test robot [this message]
2021-04-08 22:56 ` kernel test robot
2021-04-08 23:19 ` kernel test robot
2021-04-08 23:19 ` kernel test robot
2021-04-08 18:33 ` [PATCH v3 3/5] btrfs: check verity for reads of inline extents and holes Boris Burkov
2021-04-08 18:33 ` [PATCH v3 4/5] btrfs: fallback to buffered io for verity files Boris Burkov
2021-04-08 18:33 ` [PATCH v3 5/5] 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=202104090627.SB8Sxzkn-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.