linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Anna Pendleton <pendleton@google.com>,
	Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org,
	Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: kbuild-all@lists.01.org, linux-ext4@vger.kernel.org,
	Anna Pendleton <pendleton@google.com>
Subject: Re: [PATCH] ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path
Date: Tue, 12 May 2020 14:37:03 +0800	[thread overview]
Message-ID: <20200512063703.GA20612@xsang-OptiPlex-9020> (raw)
In-Reply-To: <20200507175028.15061-1-pendleton@google.com>

Hi Anna,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on tytso-fscrypt/master v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Anna-Pendleton/ext4-avoid-ext4_error-s-caused-by-ENOMEM-in-the-truncate-path/20200508-062229
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
reproduce:
        # apt-get install sparse
        # sparse version: 
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

   fs/ext4/extents.c:493:67: sparse: warning: incorrect type in initializer (different base types)
>> fs/ext4/extents.c:493:67: sparse:    expected int gfp_flags
>> fs/ext4/extents.c:493:67: sparse:    got restricted gfp_t
   fs/ext4/extents.c:496:27: sparse: warning: invalid assignment: |=
>> fs/ext4/extents.c:496:27: sparse:    left side has type int
>> fs/ext4/extents.c:496:27: sparse:    right side has type restricted gfp_t
   fs/ext4/extents.c:498:47: sparse: warning: incorrect type in argument 3 (different base types)
>> fs/ext4/extents.c:498:47: sparse:    expected restricted gfp_t [usertype] gfp
>> fs/ext4/extents.c:498:47: sparse:    got int gfp_flags
   fs/ext4/extents.c:848:25: sparse: warning: incorrect type in initializer (different base types)
   fs/ext4/extents.c:848:25: sparse:    expected int gfp_flags
   fs/ext4/extents.c:848:25: sparse:    got restricted gfp_t
   fs/ext4/extents.c:851:27: sparse: warning: invalid assignment: |=
   fs/ext4/extents.c:851:27: sparse:    left side has type int
   fs/ext4/extents.c:851:27: sparse:    right side has type restricted gfp_t
   fs/ext4/extents.c:872:33: sparse: warning: incorrect type in argument 3 (different base types)
>> fs/ext4/extents.c:872:33: sparse:    expected restricted gfp_t [usertype] flags
   fs/ext4/extents.c:872:33: sparse:    got int gfp_flags
   fs/ext4/extents.c:1022:25: sparse: warning: incorrect type in initializer (different base types)
   fs/ext4/extents.c:1022:25: sparse:    expected int gfp_flags
   fs/ext4/extents.c:1022:25: sparse:    got restricted gfp_t
   fs/ext4/extents.c:1027:27: sparse: warning: invalid assignment: |=
   fs/ext4/extents.c:1027:27: sparse:    left side has type int
   fs/ext4/extents.c:1027:27: sparse:    right side has type restricted gfp_t
   fs/ext4/extents.c:1062:56: sparse: warning: incorrect type in argument 3 (different base types)
   fs/ext4/extents.c:1062:56: sparse:    expected restricted gfp_t [usertype] flags
   fs/ext4/extents.c:1062:56: sparse:    got int gfp_flags

# https://github.com/0day-ci/linux/commit/7d07f7d72800b68a55822a5705514d3c3bc82b63
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 7d07f7d72800b68a55822a5705514d3c3bc82b63
vim +493 fs/ext4/extents.c

4068664e3cd231 Dmitry Monakhov 2019-11-06  485  
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  486  static struct buffer_head *
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  487  __read_extent_tree_block(const char *function, unsigned int line,
107a7bd31ac003 Theodore Ts'o   2013-08-16  488  			 struct inode *inode, ext4_fsblk_t pblk, int depth,
107a7bd31ac003 Theodore Ts'o   2013-08-16  489  			 int flags)
f84891289e62a7 Darrick J. Wong 2012-04-29  490  {
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  491  	struct buffer_head		*bh;
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  492  	int				err;
7d07f7d72800b6 Theodore Ts'o   2020-05-07 @493  	int				gfp_flags = __GFP_MOVABLE | GFP_NOFS;
f84891289e62a7 Darrick J. Wong 2012-04-29  494  
7d07f7d72800b6 Theodore Ts'o   2020-05-07  495  	if (flags & EXT4_EX_NOFAIL)
7d07f7d72800b6 Theodore Ts'o   2020-05-07 @496  		gfp_flags |= __GFP_NOFAIL;
7d07f7d72800b6 Theodore Ts'o   2020-05-07  497  
7d07f7d72800b6 Theodore Ts'o   2020-05-07 @498  	bh = sb_getblk_gfp(inode->i_sb, pblk, gfp_flags);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  499  	if (unlikely(!bh))
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  500  		return ERR_PTR(-ENOMEM);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  501  
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  502  	if (!bh_uptodate_or_lock(bh)) {
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  503  		trace_ext4_ext_load_extent(inode, pblk, _RET_IP_);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  504  		err = bh_submit_read(bh);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  505  		if (err < 0)
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  506  			goto errout;
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  507  	}
7869a4a6c5caa7 Theodore Ts'o   2013-08-16  508  	if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  509  		return bh;
0a944e8a6c66ca Theodore Ts'o   2019-05-22  510  	if (!ext4_has_feature_journal(inode->i_sb) ||
0a944e8a6c66ca Theodore Ts'o   2019-05-22  511  	    (inode->i_ino !=
0a944e8a6c66ca Theodore Ts'o   2019-05-22  512  	     le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) {
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  513  		err = __ext4_ext_check(function, line, inode,
c349179b4808f7 Theodore Ts'o   2013-08-16  514  				       ext_block_hdr(bh), depth, pblk);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  515  		if (err)
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  516  			goto errout;
0a944e8a6c66ca Theodore Ts'o   2019-05-22  517  	}
f84891289e62a7 Darrick J. Wong 2012-04-29  518  	set_buffer_verified(bh);
107a7bd31ac003 Theodore Ts'o   2013-08-16  519  	/*
107a7bd31ac003 Theodore Ts'o   2013-08-16  520  	 * If this is a leaf block, cache all of its entries
107a7bd31ac003 Theodore Ts'o   2013-08-16  521  	 */
107a7bd31ac003 Theodore Ts'o   2013-08-16  522  	if (!(flags & EXT4_EX_NOCACHE) && depth == 0) {
107a7bd31ac003 Theodore Ts'o   2013-08-16  523  		struct ext4_extent_header *eh = ext_block_hdr(bh);
4068664e3cd231 Dmitry Monakhov 2019-11-06  524  		ext4_cache_extents(inode, eh);
107a7bd31ac003 Theodore Ts'o   2013-08-16  525  	}
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  526  	return bh;
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  527  errout:
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  528  	put_bh(bh);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  529  	return ERR_PTR(err);
7d7ea89e756ea1 Theodore Ts'o   2013-08-16  530  

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


  reply	other threads:[~2020-05-12  6:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 17:50 [PATCH] ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path Anna Pendleton
2020-05-12  6:37 ` kbuild test robot [this message]
2020-05-21 16:55 ` Theodore Y. Ts'o

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=20200512063703.GA20612@xsang-OptiPlex-9020 \
    --to=lkp@intel.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=harshadshirwadkar@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=pendleton@google.com \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).