All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 3/4] ext4: factor out write end code of inline file
Date: Tue, 06 Jul 2021 13:48:01 +0800	[thread overview]
Message-ID: <202107061345.Y6myMYDy-lkp@intel.com> (raw)
In-Reply-To: <20210706024210.746788-4-yi.zhang@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 5480 bytes --]

Hi Zhang,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on ext4/dev]
[also build test WARNING on v5.13 next-20210701]
[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/Zhang-Yi/ext4-improve-delalloc-buffer-write-performance/20210706-103431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: arm-randconfig-r016-20210706 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 873e8b96b1226d64e4f95083147d8592ba7bd5d8)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/b6bfc15d82616d158c3b969e1796d4848b70e354
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Zhang-Yi/ext4-improve-delalloc-buffer-write-performance/20210706-103431
        git checkout b6bfc15d82616d158c3b969e1796d4848b70e354
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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/ext4/inline.c:742:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (likely(copied)) {
               ^~~~~~~~~~~~~~
   include/linux/compiler.h:77:20: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/inline.c:793:7: note: uninitialized use occurs here
           if (!ret)
                ^~~
   fs/ext4/inline.c:742:2: note: remove the 'if' if its condition is always true
           if (likely(copied)) {
           ^~~~~~~~~~~~~~~~~~~~
   fs/ext4/inline.c:737:9: note: initialize the variable 'ret' to silence this warning
           int ret, ret2;
                  ^
                   = 0
   1 warning generated.


vim +742 fs/ext4/inline.c

   728	
   729	int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
   730				       unsigned copied, struct page *page)
   731	{
   732		handle_t *handle = ext4_journal_current_handle();
   733		int i_size_changed = 0;
   734		int no_expand;
   735		void *kaddr;
   736		struct ext4_iloc iloc;
   737		int ret, ret2;
   738	
   739		if (unlikely(copied < len) && !PageUptodate(page))
   740			copied = 0;
   741	
 > 742		if (likely(copied)) {
   743			ret = ext4_get_inode_loc(inode, &iloc);
   744			if (ret) {
   745				unlock_page(page);
   746				put_page(page);
   747				ext4_std_error(inode->i_sb, ret);
   748				goto out;
   749			}
   750			ext4_write_lock_xattr(inode, &no_expand);
   751			BUG_ON(!ext4_has_inline_data(inode));
   752	
   753			kaddr = kmap_atomic(page);
   754			ext4_write_inline_data(inode, &iloc, kaddr, pos, copied);
   755			kunmap_atomic(kaddr);
   756			SetPageUptodate(page);
   757			/* clear page dirty so that writepages wouldn't work for us. */
   758			ClearPageDirty(page);
   759	
   760			ext4_write_unlock_xattr(inode, &no_expand);
   761			brelse(iloc.bh);
   762		}
   763	
   764		/*
   765		 * It's important to update i_size while still holding page lock:
   766		 * page writeout could otherwise come in and zero beyond i_size.
   767		 */
   768		i_size_changed = ext4_update_inode_size(inode, pos + copied);
   769		if (ext4_should_journal_data(inode)) {
   770			ext4_set_inode_state(inode, EXT4_STATE_JDATA);
   771			EXT4_I(inode)->i_datasync_tid = handle->h_transaction->t_tid;
   772		}
   773		unlock_page(page);
   774		put_page(page);
   775	
   776		/*
   777		 * Don't mark the inode dirty under page lock. First, it unnecessarily
   778		 * makes the holding time of page lock longer. Second, it forces lock
   779		 * ordering of page lock and transaction start for journaling
   780		 * filesystems.
   781		 */
   782		if (likely(copied) || i_size_changed)
   783			mark_inode_dirty(inode);
   784	out:
   785		/*
   786		 * If we have allocated more blocks and copied less. We will have
   787		 * blocks allocated outside inode->i_size, so truncate them.
   788		 */
   789		if (pos + len > inode->i_size && ext4_can_truncate(inode))
   790			ext4_orphan_add(handle, inode);
   791	
   792		ret2 = ext4_journal_stop(handle);
   793		if (!ret)
   794			ret = ret2;
   795		if (pos + len > inode->i_size) {
   796			ext4_truncate_failed_write(inode);
   797			/*
   798			 * If truncate failed early the inode might still be
   799			 * on the orphan list; we need to make sure the inode
   800			 * is removed from the orphan list in that case.
   801			 */
   802			if (inode->i_nlink)
   803				ext4_orphan_del(NULL, inode);
   804		}
   805		return ret ? ret : copied;
   806	}
   807	

---
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: 36949 bytes --]

  parent reply	other threads:[~2021-07-06  5:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  2:42 [RFC PATCH 0/4] ext4: improve delalloc buffer write performance Zhang Yi
2021-07-06  2:42 ` [RFC PATCH 1/4] ext4: check and update i_disksize properly Zhang Yi
2021-07-06 12:11   ` Jan Kara
2021-07-06 14:40     ` Zhang Yi
2021-07-06 15:26       ` Jan Kara
2021-07-07  6:18         ` Zhang Yi
2021-07-06  2:42 ` [RFC PATCH 2/4] ext4: correct the error path of ext4_write_inline_data_end() Zhang Yi
2021-07-06 12:28   ` Jan Kara
2021-07-06  2:42 ` [RFC PATCH 3/4] ext4: factor out write end code of inline file Zhang Yi
2021-07-06  5:45   ` kernel test robot
2021-07-06  5:48   ` kernel test robot [this message]
2021-07-07 16:49   ` Jan Kara
2021-07-10  8:13     ` Zhang Yi
2021-07-06  2:42 ` [RFC PATCH 4/4] ext4: drop unnecessary journal handle in delalloc write Zhang Yi
2021-07-07 16:59   ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2021-07-06  5:13 [RFC PATCH 3/4] ext4: factor out write end code of inline file kernel test robot
2021-07-06  7:05 kernel test robot
2021-07-06  9:00 ` [kbuild] " Dan Carpenter

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=202107061345.Y6myMYDy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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.