All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
Subject: [chao:wip 5/5] fs/f2fs/namei.c:469:15: warning: unused variable 'root_ino'
Date: Wed, 4 Sep 2024 19:38:52 +0800	[thread overview]
Message-ID: <202409041931.QlsPggLS-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip
head:   69dc8fbbbb39f85f9f436ca562c98afbcc2a48d2
commit: 69dc8fbbbb39f85f9f436ca562c98afbcc2a48d2 [5/5] f2fs: get rid of online repaire on corrupted directory
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240904/202409041931.QlsPggLS-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240904/202409041931.QlsPggLS-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/202409041931.QlsPggLS-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/f2fs/namei.c:469:15: warning: unused variable 'root_ino' [-Wunused-variable]
     469 |         unsigned int root_ino = F2FS_ROOT_INO(F2FS_I_SB(dir));
         |                      ^~~~~~~~
   1 warning generated.


vim +/root_ino +469 fs/f2fs/namei.c

57397d86c62dfe Jaegeuk Kim             2012-11-02  459  
57397d86c62dfe Jaegeuk Kim             2012-11-02  460  static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
57397d86c62dfe Jaegeuk Kim             2012-11-02  461  		unsigned int flags)
57397d86c62dfe Jaegeuk Kim             2012-11-02  462  {
57397d86c62dfe Jaegeuk Kim             2012-11-02  463  	struct inode *inode = NULL;
57397d86c62dfe Jaegeuk Kim             2012-11-02  464  	struct f2fs_dir_entry *de;
57397d86c62dfe Jaegeuk Kim             2012-11-02  465  	struct page *page;
0c5e36db17f5fe Chao Yu                 2017-10-17  466  	struct dentry *new;
0c5e36db17f5fe Chao Yu                 2017-10-17  467  	nid_t ino = -1;
fcc85a4d86b501 Jaegeuk Kim             2015-04-21  468  	int err = 0;
8c2b1435b9f489 Liu Xue                 2016-02-26 @469  	unsigned int root_ino = F2FS_ROOT_INO(F2FS_I_SB(dir));
43c780ba26244e Eric Biggers            2020-05-07  470  	struct f2fs_filename fname;
57397d86c62dfe Jaegeuk Kim             2012-11-02  471  
0c5e36db17f5fe Chao Yu                 2017-10-17  472  	trace_f2fs_lookup_start(dir, dentry, flags);
0c5e36db17f5fe Chao Yu                 2017-10-17  473  
0c5e36db17f5fe Chao Yu                 2017-10-17  474  	if (dentry->d_name.len > F2FS_NAME_LEN) {
0c5e36db17f5fe Chao Yu                 2017-10-17  475  		err = -ENAMETOOLONG;
0c5e36db17f5fe Chao Yu                 2017-10-17  476  		goto out;
0c5e36db17f5fe Chao Yu                 2017-10-17  477  	}
57397d86c62dfe Jaegeuk Kim             2012-11-02  478  
43c780ba26244e Eric Biggers            2020-05-07  479  	err = f2fs_prepare_lookup(dir, dentry, &fname);
b01531db6cec2a Eric Biggers            2019-03-20  480  	if (err == -ENOENT)
b01531db6cec2a Eric Biggers            2019-03-20  481  		goto out_splice;
b01531db6cec2a Eric Biggers            2019-03-20  482  	if (err)
b01531db6cec2a Eric Biggers            2019-03-20  483  		goto out;
b01531db6cec2a Eric Biggers            2019-03-20  484  	de = __f2fs_find_entry(dir, &fname, &page);
43c780ba26244e Eric Biggers            2020-05-07  485  	f2fs_free_filename(&fname);
b01531db6cec2a Eric Biggers            2019-03-20  486  
eb4246dc12da4a Jaegeuk Kim             2016-05-27  487  	if (!de) {
0c5e36db17f5fe Chao Yu                 2017-10-17  488  		if (IS_ERR(page)) {
0c5e36db17f5fe Chao Yu                 2017-10-17  489  			err = PTR_ERR(page);
0c5e36db17f5fe Chao Yu                 2017-10-17  490  			goto out;
0c5e36db17f5fe Chao Yu                 2017-10-17  491  		}
84597b1f9b051f Chao Yu                 2020-05-27  492  		err = -ENOENT;
0c5e36db17f5fe Chao Yu                 2017-10-17  493  		goto out_splice;
eb4246dc12da4a Jaegeuk Kim             2016-05-27  494  	}
06957e8fe6945e Jaegeuk Kim             2015-04-22  495  
06957e8fe6945e Jaegeuk Kim             2015-04-22  496  	ino = le32_to_cpu(de->ino);
57397d86c62dfe Jaegeuk Kim             2012-11-02  497  	f2fs_put_page(page, 0);
57397d86c62dfe Jaegeuk Kim             2012-11-02  498  
57397d86c62dfe Jaegeuk Kim             2012-11-02  499  	inode = f2fs_iget(dir->i_sb, ino);
0c5e36db17f5fe Chao Yu                 2017-10-17  500  	if (IS_ERR(inode)) {
0c5e36db17f5fe Chao Yu                 2017-10-17  501  		err = PTR_ERR(inode);
0c5e36db17f5fe Chao Yu                 2017-10-17  502  		goto out;
0c5e36db17f5fe Chao Yu                 2017-10-17  503  	}
510022a85839a8 Jaegeuk Kim             2015-03-30  504  
62230e0d702f61 Chandan Rajendra        2018-12-12  505  	if (IS_ENCRYPTED(dir) &&
8074bb515014d2 Jaegeuk Kim             2016-02-23  506  	    (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
8074bb515014d2 Jaegeuk Kim             2016-02-23  507  	    !fscrypt_has_permitted_context(dir, inode)) {
dcbb4c10e6d969 Joe Perches             2019-06-18  508  		f2fs_warn(F2FS_I_SB(inode), "Inconsistent encryption contexts: %lu/%lu",
faac7fd97e0827 Eric Biggers            2017-04-07  509  			  dir->i_ino, inode->i_ino);
faac7fd97e0827 Eric Biggers            2017-04-07  510  		err = -EPERM;
0c5e36db17f5fe Chao Yu                 2017-10-17  511  		goto out_iput;
8074bb515014d2 Jaegeuk Kim             2016-02-23  512  	}
0c5e36db17f5fe Chao Yu                 2017-10-17  513  out_splice:
28add38d545f44 Gabriel Krisman Bertazi 2024-06-06  514  	if (IS_ENABLED(CONFIG_UNICODE) && !inode && IS_CASEFOLDED(dir)) {
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  515  		/* Eventually we want to call d_add_ci(dentry, NULL)
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  516  		 * for negative dentries in the encoding case as
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  517  		 * well.  For now, prevent the negative dentry
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  518  		 * from being cached.
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  519  		 */
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  520  		trace_f2fs_lookup_end(dir, dentry, ino, err);
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  521  		return NULL;
2c2eb7a300cd7c Daniel Rosenberg        2019-07-23  522  	}
28add38d545f44 Gabriel Krisman Bertazi 2024-06-06  523  
0c5e36db17f5fe Chao Yu                 2017-10-17  524  	new = d_splice_alias(inode, dentry);
cadfc2f9f8c35e Wu Bo                   2023-06-01  525  	trace_f2fs_lookup_end(dir, !IS_ERR_OR_NULL(new) ? new : dentry,
cadfc2f9f8c35e Wu Bo                   2023-06-01  526  				ino, IS_ERR(new) ? PTR_ERR(new) : err);
0c5e36db17f5fe Chao Yu                 2017-10-17  527  	return new;
0c5e36db17f5fe Chao Yu                 2017-10-17  528  out_iput:
d726732c7ce951 Chao Yu                 2016-03-10  529  	iput(inode);
0c5e36db17f5fe Chao Yu                 2017-10-17  530  out:
0c5e36db17f5fe Chao Yu                 2017-10-17  531  	trace_f2fs_lookup_end(dir, dentry, ino, err);
fcc85a4d86b501 Jaegeuk Kim             2015-04-21  532  	return ERR_PTR(err);
57397d86c62dfe Jaegeuk Kim             2012-11-02  533  }
57397d86c62dfe Jaegeuk Kim             2012-11-02  534  

:::::: The code at line 469 was first introduced by commit
:::::: 8c2b1435b9f48904aaa9401d12b800ca8c4dae05 f2fs: recovery missing dot dentries in root directory

:::::: TO: Liu Xue <liuxueliu.liu@huawei.com>
:::::: CC: Jaegeuk Kim <jaegeuk@kernel.org>

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

                 reply	other threads:[~2024-09-04 11:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202409041931.QlsPggLS-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chao@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yuchao0@huawei.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 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.