tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: 74cb9d74e6b6e93cae875cc04536f543eacb1704
commit: ddf7e924603ee9838823a02de7e3940cc061f43f [12196/12326] btrfs: make
btrfs_invalidatepage work on btrfs_inode
config: parisc-randconfig-m031-20210321 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout ddf7e924603ee9838823a02de7e3940cc061f43f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/mm.h:99,
from include/linux/highmem.h:8,
from include/linux/bio.h:8,
from fs/btrfs/inode.c:7:
include/asm-generic/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:91:9: warning: variable 'old_pte' set but not
used [-Wunused-but-set-variable]
91 | pte_t old_pte; \
| ^~~~~~~
arch/parisc/include/asm/pgtable.h:316:34: note: in expansion of macro
'set_pte_at'
316 | #define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))
| ^~~~~~~~~~
include/asm-generic/pgtable.h:201:2: note: in expansion of macro 'pte_clear'
201 | pte_clear(mm, address, ptep);
| ^~~~~~~~~
include/asm-generic/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:91:9: warning: variable 'old_pte' set but not
used [-Wunused-but-set-variable]
91 | pte_t old_pte; \
| ^~~~~~~
include/asm-generic/pgtable.h:629:2: note: in expansion of macro 'set_pte_at'
629 | set_pte_at(vma->vm_mm, addr, ptep, pte);
| ^~~~~~~~~~
fs/btrfs/inode.c: In function 'btrfs_invalidatepage':
> fs/btrfs/inode.c:9055:39: error: passing argument 1 of
'btrfs_dec_test_ordered_pending' from incompatible pointer type
[-Werror=incompatible-pointer-types]
9055 | if
(btrfs_dec_test_ordered_pending(inode, &ordered,
| ^~~~~
| |
| struct btrfs_inode *
In file included from fs/btrfs/btrfs_inode.h:12,
from fs/btrfs/transaction.h:10,
from fs/btrfs/inode.c:36:
fs/btrfs/ordered-data.h:156:50: note: expected 'struct inode *' but argument is
of type 'struct btrfs_inode *'
156 | int btrfs_dec_test_ordered_pending(struct inode *inode,
| ~~~~~~~~~~~~~~^~~~~
> fs/btrfs/inode.c:9085:25: error: passing argument 1 of
'btrfs_qgroup_free_data' from incompatible pointer type
[-Werror=incompatible-pointer-types]
9085 | btrfs_qgroup_free_data(inode, NULL,
page_start, PAGE_SIZE);
| ^~~~~
| |
| struct btrfs_inode *
In file included from fs/btrfs/inode.c:49:
fs/btrfs/qgroup.h:350:42: note: expected 'struct inode *' but argument is of
type 'struct btrfs_inode *'
350 | int btrfs_qgroup_free_data(struct inode *inode,
| ~~~~~~~~~~~~~~^~~~~
cc1: some warnings being treated as errors
vim +/btrfs_dec_test_ordered_pending +9055 fs/btrfs/inode.c
e6dcd2dc9c4891 Chris Mason 2008-07-17 8994
d47992f86b3079 Lukas Czerner 2013-05-21 8995 static void
btrfs_invalidatepage(struct page *page, unsigned int offset,
d47992f86b3079 Lukas Czerner 2013-05-21 8996 unsigned int length)
39279cc3d2704c Chris Mason 2007-06-12 8997 {
ddf7e924603ee9 Nikolay Borisov 2020-08-31 8998 struct btrfs_inode *inode =
BTRFS_I(page->mapping->host);
ddf7e924603ee9 Nikolay Borisov 2020-08-31 8999 struct extent_io_tree *tree =
&inode->io_tree;
e6dcd2dc9c4891 Chris Mason 2008-07-17 9000 struct btrfs_ordered_extent
*ordered;
2ac55d41b5d6bf Josef Bacik 2010-02-03 9001 struct extent_state
*cached_state = NULL;
e6dcd2dc9c4891 Chris Mason 2008-07-17 9002 u64 page_start =
page_offset(page);
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 9003 u64 page_end = page_start +
PAGE_SIZE - 1;
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9004 u64 start;
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9005 u64 end;
ddf7e924603ee9 Nikolay Borisov 2020-08-31 9006 int inode_evicting =
inode->vfs_inode.i_state & I_FREEING;
39279cc3d2704c Chris Mason 2007-06-12 9007
8b62b72b26bcd7 Chris Mason 2009-09-02 9008 /*
8b62b72b26bcd7 Chris Mason 2009-09-02 9009 * we have the page locked, so
new writeback can't start,
8b62b72b26bcd7 Chris Mason 2009-09-02 9010 * and the dirty bit won't
be cleared while we are here.
8b62b72b26bcd7 Chris Mason 2009-09-02 9011 *
8b62b72b26bcd7 Chris Mason 2009-09-02 9012 * Wait for IO on this page so
that we can safely clear
8b62b72b26bcd7 Chris Mason 2009-09-02 9013 * the PagePrivate2 bit and do
ordered accounting
8b62b72b26bcd7 Chris Mason 2009-09-02 9014 */
e6dcd2dc9c4891 Chris Mason 2008-07-17 9015 wait_on_page_writeback(page);
8b62b72b26bcd7 Chris Mason 2009-09-02 9016
e6dcd2dc9c4891 Chris Mason 2008-07-17 9017 if (offset) {
a52d9a8033c454 Chris Mason 2007-08-27 9018 btrfs_releasepage(page,
GFP_NOFS);
e6dcd2dc9c4891 Chris Mason 2008-07-17 9019 return;
e6dcd2dc9c4891 Chris Mason 2008-07-17 9020 }
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9021
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9022 if (!inode_evicting)
ff13db41f184f8 David Sterba 2015-12-03 9023 lock_extent_bits(tree,
page_start, page_end, &cached_state);
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9024 again:
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9025 start = page_start;
ddf7e924603ee9 Nikolay Borisov 2020-08-31 9026 ordered =
btrfs_lookup_ordered_range(inode, start, page_end - start + 1);
e6dcd2dc9c4891 Chris Mason 2008-07-17 9027 if (ordered) {
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9028 end = min(page_end,
ordered->file_offset + ordered->len - 1);
eb84ae039e10f1 Chris Mason 2008-07-17 9029 /*
eb84ae039e10f1 Chris Mason 2008-07-17 9030 * IO on this page will never
be started, so we need
eb84ae039e10f1 Chris Mason 2008-07-17 9031 * to account for any ordered
extents now
eb84ae039e10f1 Chris Mason 2008-07-17 9032 */
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9033 if (!inode_evicting)
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9034 clear_extent_bit(tree,
start, end,
e182163d9cbe86 Omar Sandoval 2019-08-15 9035 EXTENT_DELALLOC |
EXTENT_DELALLOC_NEW |
9e8a4a8b0b9484 Liu Bo 2012-09-05 9036 EXTENT_LOCKED |
EXTENT_DO_ACCOUNTING |
ae0f162534e98a David Sterba 2017-10-31 9037 EXTENT_DEFRAG, 1, 0,
&cached_state);
8b62b72b26bcd7 Chris Mason 2009-09-02 9038 /*
8b62b72b26bcd7 Chris Mason 2009-09-02 9039 * whoever cleared the
private bit is responsible
8b62b72b26bcd7 Chris Mason 2009-09-02 9040 * for the finish_ordered_io
8b62b72b26bcd7 Chris Mason 2009-09-02 9041 */
77cef2ec548456 Josef Bacik 2013-08-29 9042 if
(TestClearPagePrivate2(page)) {
77cef2ec548456 Josef Bacik 2013-08-29 9043 struct
btrfs_ordered_inode_tree *tree;
77cef2ec548456 Josef Bacik 2013-08-29 9044 u64 new_len;
77cef2ec548456 Josef Bacik 2013-08-29 9045
ddf7e924603ee9 Nikolay Borisov 2020-08-31 9046 tree =
&inode->ordered_tree;
77cef2ec548456 Josef Bacik 2013-08-29 9047
77cef2ec548456 Josef Bacik 2013-08-29 9048
spin_lock_irq(&tree->lock);
77cef2ec548456 Josef Bacik 2013-08-29 9049
set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags);
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9050 new_len = start -
ordered->file_offset;
77cef2ec548456 Josef Bacik 2013-08-29 9051 if (new_len <
ordered->truncated_len)
77cef2ec548456 Josef Bacik 2013-08-29 9052 ordered->truncated_len =
new_len;
77cef2ec548456 Josef Bacik 2013-08-29 9053
spin_unlock_irq(&tree->lock);
77cef2ec548456 Josef Bacik 2013-08-29 9054
77cef2ec548456 Josef Bacik 2013-08-29 @9055 if
(btrfs_dec_test_ordered_pending(inode, &ordered,
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9056 start,
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9057 end - start + 1, 1))
5fd02043553b02 Josef Bacik 2012-05-02 9058
btrfs_finish_ordered_io(ordered);
8b62b72b26bcd7 Chris Mason 2009-09-02 9059 }
e6dcd2dc9c4891 Chris Mason 2008-07-17 9060
btrfs_put_ordered_extent(ordered);
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9061 if (!inode_evicting) {
2ac55d41b5d6bf Josef Bacik 2010-02-03 9062 cached_state = NULL;
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9063 lock_extent_bits(tree,
start, end,
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9064 &cached_state);
e6dcd2dc9c4891 Chris Mason 2008-07-17 9065 }
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9066
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9067 start = end + 1;
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9068 if (start < page_end)
dbfdb6d1b369b8 Chandan Rajendra 2016-01-21 9069 goto again;
e6dcd2dc9c4891 Chris Mason 2008-07-17 9070 }
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9071
b9d0b38928e215 Qu Wenruo 2015-09-29 9072 /*
b9d0b38928e215 Qu Wenruo 2015-09-29 9073 * Qgroup reserved space
handler
b9d0b38928e215 Qu Wenruo 2015-09-29 9074 * Page here will be either
85c417050fc7fe Qu Wenruo 2020-07-17 9075 * 1) Already written to disk
or ordered extent already submitted
85c417050fc7fe Qu Wenruo 2020-07-17 9076 * Then its QGROUP_RESERVED
bit in io_tree is already cleaned.
85c417050fc7fe Qu Wenruo 2020-07-17 9077 * Qgroup will be handled
by its qgroup_record then.
85c417050fc7fe Qu Wenruo 2020-07-17 9078 * btrfs_qgroup_free_data()
call will do nothing here.
85c417050fc7fe Qu Wenruo 2020-07-17 9079 *
85c417050fc7fe Qu Wenruo 2020-07-17 9080 * 2) Not written to disk yet
85c417050fc7fe Qu Wenruo 2020-07-17 9081 * Then
btrfs_qgroup_free_data() call will clear the QGROUP_RESERVED
85c417050fc7fe Qu Wenruo 2020-07-17 9082 * bit of its io_tree, and
free the qgroup reserved data space.
85c417050fc7fe Qu Wenruo 2020-07-17 9083 * Since the IO will never
happen for this page.
85c417050fc7fe Qu Wenruo 2020-07-17 9084 */
bc42bda22345ef Qu Wenruo 2017-02-27 @9085 btrfs_qgroup_free_data(inode,
NULL, page_start, PAGE_SIZE);
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9086 if (!inode_evicting) {
e182163d9cbe86 Omar Sandoval 2019-08-15 9087 clear_extent_bit(tree,
page_start, page_end, EXTENT_LOCKED |
a7e3b975a0f929 Filipe Manana 2017-04-03 9088 EXTENT_DELALLOC |
EXTENT_DELALLOC_NEW |
a7e3b975a0f929 Filipe Manana 2017-04-03 9089 EXTENT_DO_ACCOUNTING |
EXTENT_DEFRAG, 1, 1,
ae0f162534e98a David Sterba 2017-10-31 9090 &cached_state);
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9091
e6dcd2dc9c4891 Chris Mason 2008-07-17 9092 __btrfs_releasepage(page,
GFP_NOFS);
131e404a2a54d3 Filipe David Borba Manana 2013-11-19 9093 }
e6dcd2dc9c4891 Chris Mason 2008-07-17 9094
4a096752796740 Chris Mason 2008-07-21 9095 ClearPageChecked(page);
9ad6b7bc2e00ba Chris Mason 2008-04-18 9096 if (PagePrivate(page)) {
9ad6b7bc2e00ba Chris Mason 2008-04-18 9097 ClearPagePrivate(page);
9ad6b7bc2e00ba Chris Mason 2008-04-18 9098 set_page_private(page, 0);
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 9099 put_page(page);
9ad6b7bc2e00ba Chris Mason 2008-04-18 9100 }
39279cc3d2704c Chris Mason 2007-06-12 9101 }
39279cc3d2704c Chris Mason 2007-06-12 9102
:::::: The code at line 9055 was first introduced by commit
:::::: 77cef2ec5484564eca6bd12a2b4a1e88fd766fbc Btrfs: allow partial ordered extent
completion
:::::: TO: Josef Bacik <jbacik(a)fusionio.com>
:::::: CC: Chris Mason <chris.mason(a)fusionio.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org