Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] fs: fix ext4 unused-variable warning
@ 2020-01-07 20:02 Arnd Bergmann
  2020-01-07 23:19 ` Darrick J. Wong
  2020-01-10 12:25 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-01-07 20:02 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Darrick J. Wong
  Cc: Arnd Bergmann, Andreas Gruenbacher, David Sterba,
	Richard Weinberger, Jan Kara, Ritesh Harjani, Eric Biggers,
	Matthew Bobrowski, Chandan Rajendra, Eric Whitney, linux-ext4,
	linux-kernel

A bugfix introduce a harmless warning:

fs/ext4/inode.c: In function 'ext4_page_mkwrite':
fs/ext4/inode.c:5910:24: error: unused variable 'mapping' [-Werror=unused-variable]

Remove the now-unused variable.

Fixes: 4a58d8158f6d ("fs: Fix page_mkwrite off-by-one errors")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/ext4/inode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9a3e8d075cd0..d0049fd0bfd4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5907,7 +5907,6 @@ vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
 	vm_fault_t ret;
 	struct file *file = vma->vm_file;
 	struct inode *inode = file_inode(file);
-	struct address_space *mapping = inode->i_mapping;
 	handle_t *handle;
 	get_block_t *get_block;
 	int retries = 0;
-- 
2.20.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: fix ext4 unused-variable warning
  2020-01-07 20:02 [PATCH] fs: fix ext4 unused-variable warning Arnd Bergmann
@ 2020-01-07 23:19 ` Darrick J. Wong
  2020-01-10 12:25 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2020-01-07 23:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Theodore Ts'o, Andreas Dilger, Andreas Gruenbacher,
	David Sterba, Richard Weinberger, Jan Kara, Ritesh Harjani,
	Eric Biggers, Matthew Bobrowski, Chandan Rajendra, Eric Whitney,
	linux-ext4, linux-kernel

On Tue, Jan 07, 2020 at 09:02:12PM +0100, Arnd Bergmann wrote:
> A bugfix introduce a harmless warning:
> 
> fs/ext4/inode.c: In function 'ext4_page_mkwrite':
> fs/ext4/inode.c:5910:24: error: unused variable 'mapping' [-Werror=unused-variable]
> 
> Remove the now-unused variable.
> 
> Fixes: 4a58d8158f6d ("fs: Fix page_mkwrite off-by-one errors")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

FWIW I dropped the f2fs parts of the patch because there were conflicts
and they never acked the patch, so I fixed this at the same time.

--D

> ---
>  fs/ext4/inode.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 9a3e8d075cd0..d0049fd0bfd4 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5907,7 +5907,6 @@ vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
>  	vm_fault_t ret;
>  	struct file *file = vma->vm_file;
>  	struct inode *inode = file_inode(file);
> -	struct address_space *mapping = inode->i_mapping;
>  	handle_t *handle;
>  	get_block_t *get_block;
>  	int retries = 0;
> -- 
> 2.20.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: fix ext4 unused-variable warning
  2020-01-07 20:02 [PATCH] fs: fix ext4 unused-variable warning Arnd Bergmann
  2020-01-07 23:19 ` Darrick J. Wong
@ 2020-01-10 12:25 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2020-01-10 12:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Theodore Ts'o, Andreas Dilger, Darrick J. Wong,
	Arnd Bergmann, Andreas Gruenbacher, David Sterba,
	Richard Weinberger, Jan Kara, Ritesh Harjani, Eric Biggers,
	Matthew Bobrowski, Chandan Rajendra, Eric Whitney, linux-ext4,
	linux-kernel

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

Hi Arnd,

I love your patch! Yet something to improve:

[auto build test ERROR on ext4/dev]
[also build test ERROR on arm-soc/for-next tytso-fscrypt/master v5.5-rc5]
[cannot apply to next-20200109]
[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/Arnd-Bergmann/fs-fix-ext4-unused-variable-warning/20200109-065901
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: x86_64-lkp (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All errors (new ones prefixed by >>):

   fs//ext4/inode.c: In function 'ext4_page_mkwrite':
>> fs//ext4/inode.c:5942:23: error: 'mapping' undeclared (first use in this function)
     if (page->mapping != mapping || page_offset(page) > size) {
                          ^~~~~~~
   fs//ext4/inode.c:5942:23: note: each undeclared identifier is reported only once for each function it appears in

vim +/mapping +5942 fs//ext4/inode.c

2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5900  
401b25aa1a75e7 Souptick Joarder   2018-10-02  5901  vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5902  {
11bac80004499e Dave Jiang         2017-02-24  5903  	struct vm_area_struct *vma = vmf->vma;
c2ec175c39f629 Nick Piggin        2009-03-31  5904  	struct page *page = vmf->page;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5905  	loff_t size;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5906  	unsigned long len;
401b25aa1a75e7 Souptick Joarder   2018-10-02  5907  	int err;
401b25aa1a75e7 Souptick Joarder   2018-10-02  5908  	vm_fault_t ret;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5909  	struct file *file = vma->vm_file;
496ad9aa8ef448 Al Viro            2013-01-23  5910  	struct inode *inode = file_inode(file);
9ea7df534ed2a1 Jan Kara           2011-06-24  5911  	handle_t *handle;
9ea7df534ed2a1 Jan Kara           2011-06-24  5912  	get_block_t *get_block;
9ea7df534ed2a1 Jan Kara           2011-06-24  5913  	int retries = 0;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5914  
02b016ca7f9922 Theodore Ts'o      2019-06-09  5915  	if (unlikely(IS_IMMUTABLE(inode)))
02b016ca7f9922 Theodore Ts'o      2019-06-09  5916  		return VM_FAULT_SIGBUS;
02b016ca7f9922 Theodore Ts'o      2019-06-09  5917  
8e8ad8a57c75f3 Jan Kara           2012-06-12  5918  	sb_start_pagefault(inode->i_sb);
041bbb6d369811 Theodore Ts'o      2012-09-30  5919  	file_update_time(vma->vm_file);
ea3d7209ca01da Jan Kara           2015-12-07  5920  
ea3d7209ca01da Jan Kara           2015-12-07  5921  	down_read(&EXT4_I(inode)->i_mmap_sem);
7b4cc9787fe35b Eric Biggers       2017-04-30  5922  
401b25aa1a75e7 Souptick Joarder   2018-10-02  5923  	err = ext4_convert_inline_data(inode);
401b25aa1a75e7 Souptick Joarder   2018-10-02  5924  	if (err)
7b4cc9787fe35b Eric Biggers       2017-04-30  5925  		goto out_ret;
7b4cc9787fe35b Eric Biggers       2017-04-30  5926  
9ea7df534ed2a1 Jan Kara           2011-06-24  5927  	/* Delalloc case is easy... */
9ea7df534ed2a1 Jan Kara           2011-06-24  5928  	if (test_opt(inode->i_sb, DELALLOC) &&
9ea7df534ed2a1 Jan Kara           2011-06-24  5929  	    !ext4_should_journal_data(inode) &&
9ea7df534ed2a1 Jan Kara           2011-06-24  5930  	    !ext4_nonda_switch(inode->i_sb)) {
9ea7df534ed2a1 Jan Kara           2011-06-24  5931  		do {
401b25aa1a75e7 Souptick Joarder   2018-10-02  5932  			err = block_page_mkwrite(vma, vmf,
9ea7df534ed2a1 Jan Kara           2011-06-24  5933  						   ext4_da_get_block_prep);
401b25aa1a75e7 Souptick Joarder   2018-10-02  5934  		} while (err == -ENOSPC &&
9ea7df534ed2a1 Jan Kara           2011-06-24  5935  		       ext4_should_retry_alloc(inode->i_sb, &retries));
9ea7df534ed2a1 Jan Kara           2011-06-24  5936  		goto out_ret;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5937  	}
0e499890c1fd9e Darrick J. Wong    2011-05-18  5938  
0e499890c1fd9e Darrick J. Wong    2011-05-18  5939  	lock_page(page);
9ea7df534ed2a1 Jan Kara           2011-06-24  5940  	size = i_size_read(inode);
9ea7df534ed2a1 Jan Kara           2011-06-24  5941  	/* Page got truncated from under us? */
9ea7df534ed2a1 Jan Kara           2011-06-24 @5942  	if (page->mapping != mapping || page_offset(page) > size) {
9ea7df534ed2a1 Jan Kara           2011-06-24  5943  		unlock_page(page);
9ea7df534ed2a1 Jan Kara           2011-06-24  5944  		ret = VM_FAULT_NOPAGE;
9ea7df534ed2a1 Jan Kara           2011-06-24  5945  		goto out;
0e499890c1fd9e Darrick J. Wong    2011-05-18  5946  	}
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5947  
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  5948  	if (page->index == size >> PAGE_SHIFT)
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  5949  		len = size & ~PAGE_MASK;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5950  	else
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  5951  		len = PAGE_SIZE;
a827eaffff07c7 Aneesh Kumar K.V   2009-09-09  5952  	/*
9ea7df534ed2a1 Jan Kara           2011-06-24  5953  	 * Return if we have all the buffers mapped. This avoids the need to do
9ea7df534ed2a1 Jan Kara           2011-06-24  5954  	 * journal_start/journal_stop which can block and take a long time
a827eaffff07c7 Aneesh Kumar K.V   2009-09-09  5955  	 */
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5956  	if (page_has_buffers(page)) {
f19d5870cbf72d Tao Ma             2012-12-10  5957  		if (!ext4_walk_page_buffers(NULL, page_buffers(page),
f19d5870cbf72d Tao Ma             2012-12-10  5958  					    0, len, NULL,
a827eaffff07c7 Aneesh Kumar K.V   2009-09-09  5959  					    ext4_bh_unmapped)) {
9ea7df534ed2a1 Jan Kara           2011-06-24  5960  			/* Wait so that we don't change page under IO */
1d1d1a767206fb Darrick J. Wong    2013-02-21  5961  			wait_for_stable_page(page);
9ea7df534ed2a1 Jan Kara           2011-06-24  5962  			ret = VM_FAULT_LOCKED;
9ea7df534ed2a1 Jan Kara           2011-06-24  5963  			goto out;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5964  		}
a827eaffff07c7 Aneesh Kumar K.V   2009-09-09  5965  	}
a827eaffff07c7 Aneesh Kumar K.V   2009-09-09  5966  	unlock_page(page);
9ea7df534ed2a1 Jan Kara           2011-06-24  5967  	/* OK, we need to fill the hole... */
9ea7df534ed2a1 Jan Kara           2011-06-24  5968  	if (ext4_should_dioread_nolock(inode))
705965bd6dfadc Jan Kara           2016-03-08  5969  		get_block = ext4_get_block_unwritten;
9ea7df534ed2a1 Jan Kara           2011-06-24  5970  	else
9ea7df534ed2a1 Jan Kara           2011-06-24  5971  		get_block = ext4_get_block;
9ea7df534ed2a1 Jan Kara           2011-06-24  5972  retry_alloc:
9924a92a8c2175 Theodore Ts'o      2013-02-08  5973  	handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE,
9924a92a8c2175 Theodore Ts'o      2013-02-08  5974  				    ext4_writepage_trans_blocks(inode));
9ea7df534ed2a1 Jan Kara           2011-06-24  5975  	if (IS_ERR(handle)) {
9ea7df534ed2a1 Jan Kara           2011-06-24  5976  		ret = VM_FAULT_SIGBUS;
9ea7df534ed2a1 Jan Kara           2011-06-24  5977  		goto out;
9ea7df534ed2a1 Jan Kara           2011-06-24  5978  	}
401b25aa1a75e7 Souptick Joarder   2018-10-02  5979  	err = block_page_mkwrite(vma, vmf, get_block);
401b25aa1a75e7 Souptick Joarder   2018-10-02  5980  	if (!err && ext4_should_journal_data(inode)) {
f19d5870cbf72d Tao Ma             2012-12-10  5981  		if (ext4_walk_page_buffers(handle, page_buffers(page), 0,
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  5982  			  PAGE_SIZE, NULL, do_journal_get_write_access)) {
9ea7df534ed2a1 Jan Kara           2011-06-24  5983  			unlock_page(page);
c2ec175c39f629 Nick Piggin        2009-03-31  5984  			ret = VM_FAULT_SIGBUS;
fcbb5515825f1b Yongqiang Yang     2011-10-26  5985  			ext4_journal_stop(handle);
9ea7df534ed2a1 Jan Kara           2011-06-24  5986  			goto out;
9ea7df534ed2a1 Jan Kara           2011-06-24  5987  		}
9ea7df534ed2a1 Jan Kara           2011-06-24  5988  		ext4_set_inode_state(inode, EXT4_STATE_JDATA);
9ea7df534ed2a1 Jan Kara           2011-06-24  5989  	}
9ea7df534ed2a1 Jan Kara           2011-06-24  5990  	ext4_journal_stop(handle);
401b25aa1a75e7 Souptick Joarder   2018-10-02  5991  	if (err == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
9ea7df534ed2a1 Jan Kara           2011-06-24  5992  		goto retry_alloc;
9ea7df534ed2a1 Jan Kara           2011-06-24  5993  out_ret:
401b25aa1a75e7 Souptick Joarder   2018-10-02  5994  	ret = block_page_mkwrite_return(err);
9ea7df534ed2a1 Jan Kara           2011-06-24  5995  out:
ea3d7209ca01da Jan Kara           2015-12-07  5996  	up_read(&EXT4_I(inode)->i_mmap_sem);
8e8ad8a57c75f3 Jan Kara           2012-06-12  5997  	sb_end_pagefault(inode->i_sb);
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5998  	return ret;
2e9ee850355593 Aneesh Kumar K.V   2008-07-11  5999  }
ea3d7209ca01da Jan Kara           2015-12-07  6000  

:::::: The code at line 5942 was first introduced by commit
:::::: 9ea7df534ed2a18157434a496a12cf073ca00c52 ext4: Rewrite ext4_page_mkwrite() to use generic helpers

:::::: TO: Jan Kara <jack@suse.cz>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28789 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 20:02 [PATCH] fs: fix ext4 unused-variable warning Arnd Bergmann
2020-01-07 23:19 ` Darrick J. Wong
2020-01-10 12:25 ` kbuild test robot

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git