mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>,
	linux-ext4@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Mingming Cao <cmm@us.ibm.com>, Kalpak Shah <kalpak@clusterfs.com>,
	linux-kernel@vger.kernel.org, kernel-dev@igalia.com,
	Thadeu Lima de Souza Cascardo <cascardo@igalia.com>,
	syzbot+57934e2c8e7a99992e41@syzkaller.appspotmail.com
Subject: Re: [PATCH] ext4: only test for inode xattr state when expanding inode
Date: Wed, 11 Dec 2024 13:12:14 +0800	[thread overview]
Message-ID: <202412111225.cNzuFVRM-lkp@intel.com> (raw)
In-Reply-To: <20241210174850.4027690-1-cascardo@igalia.com>

Hi Thadeu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tytso-ext4/dev]
[also build test WARNING on linus/master v6.13-rc2 next-20241210]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thadeu-Lima-de-Souza-Cascardo/ext4-only-test-for-inode-xattr-state-when-expanding-inode/20241211-015015
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20241210174850.4027690-1-cascardo%40igalia.com
patch subject: [PATCH] ext4: only test for inode xattr state when expanding inode
config: csky-randconfig-002-20241211 (https://download.01.org/0day-ci/archive/20241211/202412111225.cNzuFVRM-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241211/202412111225.cNzuFVRM-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412111225.cNzuFVRM-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/ext4/inode.c: In function '__ext4_expand_extra_isize':
>> fs/ext4/inode.c:5818:41: warning: variable 'header' set but not used [-Wunused-but-set-variable]
    5818 |         struct ext4_xattr_ibody_header *header;
         |                                         ^~~~~~


vim +/header +5818 fs/ext4/inode.c

ac27a0ec112a089 Dave Kleikamp                 2006-10-11  5811  
c03b45b853f5829 Miao Xie                      2017-08-06  5812  static int __ext4_expand_extra_isize(struct inode *inode,
c03b45b853f5829 Miao Xie                      2017-08-06  5813  				     unsigned int new_extra_isize,
c03b45b853f5829 Miao Xie                      2017-08-06  5814  				     struct ext4_iloc *iloc,
c03b45b853f5829 Miao Xie                      2017-08-06  5815  				     handle_t *handle, int *no_expand)
c03b45b853f5829 Miao Xie                      2017-08-06  5816  {
c03b45b853f5829 Miao Xie                      2017-08-06  5817  	struct ext4_inode *raw_inode;
c03b45b853f5829 Miao Xie                      2017-08-06 @5818  	struct ext4_xattr_ibody_header *header;
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5819  	unsigned int inode_size = EXT4_INODE_SIZE(inode->i_sb);
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5820  	struct ext4_inode_info *ei = EXT4_I(inode);
c03b45b853f5829 Miao Xie                      2017-08-06  5821  	int error;
c03b45b853f5829 Miao Xie                      2017-08-06  5822  
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5823  	/* this was checked at iget time, but double check for good measure */
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5824  	if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) ||
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5825  	    (ei->i_extra_isize & 3)) {
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5826  		EXT4_ERROR_INODE(inode, "bad extra_isize %u (inode size %u)",
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5827  				 ei->i_extra_isize,
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5828  				 EXT4_INODE_SIZE(inode->i_sb));
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5829  		return -EFSCORRUPTED;
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5830  	}
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5831  	if ((new_extra_isize < ei->i_extra_isize) ||
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5832  	    (new_extra_isize < 4) ||
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5833  	    (new_extra_isize > inode_size - EXT4_GOOD_OLD_INODE_SIZE))
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5834  		return -EINVAL;	/* Should never happen */
4ea99936a1630f5 Theodore Ts'o                 2019-11-07  5835  
c03b45b853f5829 Miao Xie                      2017-08-06  5836  	raw_inode = ext4_raw_inode(iloc);
c03b45b853f5829 Miao Xie                      2017-08-06  5837  
c03b45b853f5829 Miao Xie                      2017-08-06  5838  	header = IHDR(inode, raw_inode);
c03b45b853f5829 Miao Xie                      2017-08-06  5839  
c03b45b853f5829 Miao Xie                      2017-08-06  5840  	/* No extended attributes present */
555d75b1e3bf941 Thadeu Lima de Souza Cascardo 2024-12-10  5841  	if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR)) {
c03b45b853f5829 Miao Xie                      2017-08-06  5842  		memset((void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE +
c03b45b853f5829 Miao Xie                      2017-08-06  5843  		       EXT4_I(inode)->i_extra_isize, 0,
c03b45b853f5829 Miao Xie                      2017-08-06  5844  		       new_extra_isize - EXT4_I(inode)->i_extra_isize);
c03b45b853f5829 Miao Xie                      2017-08-06  5845  		EXT4_I(inode)->i_extra_isize = new_extra_isize;
c03b45b853f5829 Miao Xie                      2017-08-06  5846  		return 0;
c03b45b853f5829 Miao Xie                      2017-08-06  5847  	}
c03b45b853f5829 Miao Xie                      2017-08-06  5848  
8994d11395f8165 Jan Kara                      2022-12-07  5849  	/*
8994d11395f8165 Jan Kara                      2022-12-07  5850  	 * We may need to allocate external xattr block so we need quotas
8994d11395f8165 Jan Kara                      2022-12-07  5851  	 * initialized. Here we can be called with various locks held so we
8994d11395f8165 Jan Kara                      2022-12-07  5852  	 * cannot affort to initialize quotas ourselves. So just bail.
8994d11395f8165 Jan Kara                      2022-12-07  5853  	 */
8994d11395f8165 Jan Kara                      2022-12-07  5854  	if (dquot_initialize_needed(inode))
8994d11395f8165 Jan Kara                      2022-12-07  5855  		return -EAGAIN;
8994d11395f8165 Jan Kara                      2022-12-07  5856  
c03b45b853f5829 Miao Xie                      2017-08-06  5857  	/* try to expand with EAs present */
c03b45b853f5829 Miao Xie                      2017-08-06  5858  	error = ext4_expand_extra_isize_ea(inode, new_extra_isize,
c03b45b853f5829 Miao Xie                      2017-08-06  5859  					   raw_inode, handle);
c03b45b853f5829 Miao Xie                      2017-08-06  5860  	if (error) {
c03b45b853f5829 Miao Xie                      2017-08-06  5861  		/*
c03b45b853f5829 Miao Xie                      2017-08-06  5862  		 * Inode size expansion failed; don't try again
c03b45b853f5829 Miao Xie                      2017-08-06  5863  		 */
c03b45b853f5829 Miao Xie                      2017-08-06  5864  		*no_expand = 1;
c03b45b853f5829 Miao Xie                      2017-08-06  5865  	}
c03b45b853f5829 Miao Xie                      2017-08-06  5866  
c03b45b853f5829 Miao Xie                      2017-08-06  5867  	return error;
c03b45b853f5829 Miao Xie                      2017-08-06  5868  }
c03b45b853f5829 Miao Xie                      2017-08-06  5869  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-12-11  5:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 17:48 Thadeu Lima de Souza Cascardo
2024-12-11  5:12 ` kernel test robot [this message]
2024-12-11 20:06 ` [PATCH v2] " Thadeu Lima de Souza Cascardo

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=202412111225.cNzuFVRM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=cascardo@igalia.com \
    --cc=cmm@us.ibm.com \
    --cc=kalpak@clusterfs.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=syzbot+57934e2c8e7a99992e41@syzkaller.appspotmail.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

all inboxes | Powered by JetHome®