public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Boris Burkov <boris@bur.io>,
	linux-btrfs@vger.kernel.org, linux-fscrypt@vger.kernel.org,
	kernel-team@fb.com
Cc: lkp@intel.com, kbuild-all@lists.01.org
Subject: Re: [PATCH v5 2/3] btrfs: initial fsverity support
Date: Mon, 28 Jun 2021 11:23:51 +0300	[thread overview]
Message-ID: <202106260148.y7YIYV3M-lkp@intel.com> (raw)
In-Reply-To: <459e0acf996441628bc465bbe64218d7fea132c4.1624573983.git.boris@bur.io>

Hi Boris,

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: parisc-randconfig-m031-20210625 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
fs/btrfs/verity.c:268 write_key_bytes() error: uninitialized symbol 'ret'.
fs/btrfs/verity.c:745 btrfs_write_merkle_tree_block() warn: should '1 << log_blocksize' be a 64 bit type?

Old smatch warnings:
fs/btrfs/verity.c:552 btrfs_begin_enable_verity() error: uninitialized symbol 'trans'.

vim +/ret +268 fs/btrfs/verity.c

24749321fc3abc Boris Burkov 2021-06-24  209  static int write_key_bytes(struct btrfs_inode *inode, u8 key_type, u64 offset,
24749321fc3abc Boris Burkov 2021-06-24  210  			   const char *src, u64 len)
24749321fc3abc Boris Burkov 2021-06-24  211  {
24749321fc3abc Boris Burkov 2021-06-24  212  	struct btrfs_trans_handle *trans;
24749321fc3abc Boris Burkov 2021-06-24  213  	struct btrfs_path *path;
24749321fc3abc Boris Burkov 2021-06-24  214  	struct btrfs_root *root = inode->root;
24749321fc3abc Boris Burkov 2021-06-24  215  	struct extent_buffer *leaf;
24749321fc3abc Boris Burkov 2021-06-24  216  	struct btrfs_key key;
24749321fc3abc Boris Burkov 2021-06-24  217  	u64 copied = 0;
24749321fc3abc Boris Burkov 2021-06-24  218  	unsigned long copy_bytes;
24749321fc3abc Boris Burkov 2021-06-24  219  	unsigned long src_offset = 0;
24749321fc3abc Boris Burkov 2021-06-24  220  	void *data;
24749321fc3abc Boris Burkov 2021-06-24  221  	int ret;
24749321fc3abc Boris Burkov 2021-06-24  222  
24749321fc3abc Boris Burkov 2021-06-24  223  	path = btrfs_alloc_path();
24749321fc3abc Boris Burkov 2021-06-24  224  	if (!path)
24749321fc3abc Boris Burkov 2021-06-24  225  		return -ENOMEM;
24749321fc3abc Boris Burkov 2021-06-24  226  
24749321fc3abc Boris Burkov 2021-06-24  227  	while (len > 0) {

Can we write zero bytes?  My test system has linux-next so I don't know.
I don't think the kbuild bot uses the cross function DB so it doesn't
know either.

24749321fc3abc Boris Burkov 2021-06-24  228  		/*
24749321fc3abc Boris Burkov 2021-06-24  229  		 * 1 for the new item being inserted
24749321fc3abc Boris Burkov 2021-06-24  230  		 */
24749321fc3abc Boris Burkov 2021-06-24  231  		trans = btrfs_start_transaction(root, 1);
24749321fc3abc Boris Burkov 2021-06-24  232  		if (IS_ERR(trans)) {
24749321fc3abc Boris Burkov 2021-06-24  233  			ret = PTR_ERR(trans);
24749321fc3abc Boris Burkov 2021-06-24  234  			break;
24749321fc3abc Boris Burkov 2021-06-24  235  		}
24749321fc3abc Boris Burkov 2021-06-24  236  
24749321fc3abc Boris Burkov 2021-06-24  237  		key.objectid = btrfs_ino(inode);
24749321fc3abc Boris Burkov 2021-06-24  238  		key.type = key_type;
24749321fc3abc Boris Burkov 2021-06-24  239  		key.offset = offset;
24749321fc3abc Boris Burkov 2021-06-24  240  
24749321fc3abc Boris Burkov 2021-06-24  241  		/*
24749321fc3abc Boris Burkov 2021-06-24  242  		 * Insert 2K at a time mostly to be friendly for smaller
24749321fc3abc Boris Burkov 2021-06-24  243  		 * leaf size filesystems
24749321fc3abc Boris Burkov 2021-06-24  244  		 */
24749321fc3abc Boris Burkov 2021-06-24  245  		copy_bytes = min_t(u64, len, 2048);
24749321fc3abc Boris Burkov 2021-06-24  246  
24749321fc3abc Boris Burkov 2021-06-24  247  		ret = btrfs_insert_empty_item(trans, root, path, &key, copy_bytes);
24749321fc3abc Boris Burkov 2021-06-24  248  		if (ret) {
24749321fc3abc Boris Burkov 2021-06-24  249  			btrfs_end_transaction(trans);
24749321fc3abc Boris Burkov 2021-06-24  250  			break;
24749321fc3abc Boris Burkov 2021-06-24  251  		}
24749321fc3abc Boris Burkov 2021-06-24  252  
24749321fc3abc Boris Burkov 2021-06-24  253  		leaf = path->nodes[0];
24749321fc3abc Boris Burkov 2021-06-24  254  
24749321fc3abc Boris Burkov 2021-06-24  255  		data = btrfs_item_ptr(leaf, path->slots[0], void);
24749321fc3abc Boris Burkov 2021-06-24  256  		write_extent_buffer(leaf, src + src_offset,
24749321fc3abc Boris Burkov 2021-06-24  257  				    (unsigned long)data, copy_bytes);
24749321fc3abc Boris Burkov 2021-06-24  258  		offset += copy_bytes;
24749321fc3abc Boris Burkov 2021-06-24  259  		src_offset += copy_bytes;
24749321fc3abc Boris Burkov 2021-06-24  260  		len -= copy_bytes;
24749321fc3abc Boris Burkov 2021-06-24  261  		copied += copy_bytes;
24749321fc3abc Boris Burkov 2021-06-24  262  
24749321fc3abc Boris Burkov 2021-06-24  263  		btrfs_release_path(path);
24749321fc3abc Boris Burkov 2021-06-24  264  		btrfs_end_transaction(trans);
24749321fc3abc Boris Burkov 2021-06-24  265  	}
24749321fc3abc Boris Burkov 2021-06-24  266  
24749321fc3abc Boris Burkov 2021-06-24  267  	btrfs_free_path(path);
24749321fc3abc Boris Burkov 2021-06-24 @268  	return ret;
24749321fc3abc Boris Burkov 2021-06-24  269  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


  parent reply	other threads:[~2021-06-28  8:24 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
2021-06-28  8:23   ` Dan Carpenter [this message]
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=202106260148.y7YIYV3M-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=boris@bur.io \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=lkp@intel.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