Re: [PATCH 2/3] dm integrity: log audit events for dm-integrity target
by kernel test robot
Hi "Michael,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on dm/for-next]
[also build test ERROR on song-md/md-next pcmoore-audit/next v5.14-rc5 next-20210812]
[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]
url: https://github.com/0day-ci/linux/commits/Michael-Wei/dm-audit-event-loggi...
base: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next
config: h8300-randconfig-r032-20210812 (attached as .config)
compiler: h8300-linux-gcc (GCC) 10.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://github.com/0day-ci/linux/commit/6fbfa051e144cc5cb000f7de14ee5b0e8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michael-Wei/dm-audit-event-logging/20210812-230045
git checkout 6fbfa051e144cc5cb000f7de14ee5b0e83d82b57
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from drivers/md/dm-integrity.c:26:
>> drivers/md/dm-audit.h:24:1: error: expected identifier or '(' before '{' token
24 | {
| ^
drivers/md/dm-audit.h:29:1: error: expected identifier or '(' before '{' token
29 | {
| ^
>> drivers/md/dm-audit.h:21:20: warning: 'dm_audit_log_bio' used but never defined
21 | static inline void dm_audit_log_bio(const char *dm_msg_prefix, const char *op,
| ^~~~~~~~~~~~~~~~
>> drivers/md/dm-audit.h:26:20: warning: 'dm_audit_log_target' used but never defined
26 | static inline void dm_audit_log_target(const char *dm_msg_prefix,
| ^~~~~~~~~~~~~~~~~~~
vim +24 drivers/md/dm-audit.h
a409dd36b7054b Michael Weiß 2021-08-12 14
a409dd36b7054b Michael Weiß 2021-08-12 15 #ifdef CONFIG_DM_AUDIT
a409dd36b7054b Michael Weiß 2021-08-12 16 void dm_audit_log_bio(const char *dm_msg_prefix, const char *op,
a409dd36b7054b Michael Weiß 2021-08-12 17 struct bio *bio, sector_t sector, int result);
a409dd36b7054b Michael Weiß 2021-08-12 18 void dm_audit_log_target(const char *dm_msg_prefix, const char *op,
a409dd36b7054b Michael Weiß 2021-08-12 19 struct dm_target *ti, int result);
a409dd36b7054b Michael Weiß 2021-08-12 20 #else
a409dd36b7054b Michael Weiß 2021-08-12 @21 static inline void dm_audit_log_bio(const char *dm_msg_prefix, const char *op,
a409dd36b7054b Michael Weiß 2021-08-12 22 struct bio *bio, sector_t sector,
a409dd36b7054b Michael Weiß 2021-08-12 23 int result);
a409dd36b7054b Michael Weiß 2021-08-12 @24 {
a409dd36b7054b Michael Weiß 2021-08-12 25 }
a409dd36b7054b Michael Weiß 2021-08-12 @26 static inline void dm_audit_log_target(const char *dm_msg_prefix,
a409dd36b7054b Michael Weiß 2021-08-12 27 const char *op, struct dm_target *ti,
a409dd36b7054b Michael Weiß 2021-08-12 28 int result);
a409dd36b7054b Michael Weiß 2021-08-12 29 {
a409dd36b7054b Michael Weiß 2021-08-12 30 }
a409dd36b7054b Michael Weiß 2021-08-12 31 #endif
a409dd36b7054b Michael Weiß 2021-08-12 32
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[intel-linux-intel-lts:5.4/yocto 15/1142] drivers/crypto/keembay/keembay-ocs-hcu-core.c:226:46: warning: shift count >= width of type
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: 9b07a958f2eb496c88faf0bd749eb600357f4190 [15/1142] crypto: keembay: Add Keem Bay OCS HCU
config: hexagon-randconfig-r041-20210811 (attached as .config)
compiler: clang version 12.0.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://github.com/intel/linux-intel-lts/commit/9b07a958f2eb496c88faf0bd7...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 9b07a958f2eb496c88faf0bd749eb600357f4190
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/crypto/keembay/keembay-ocs-hcu-core.c:226:46: warning: shift count >= width of type [-Wshift-count-overflow]
if (addr & KMB_OCS_HCU_ALIGN_MASK || addr > OCS_HCU_DMA_MAX_ADDR_MASK)
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/crypto/keembay/ocs-hcu.h:30:36: note: expanded from macro 'OCS_HCU_DMA_MAX_ADDR_MASK'
#define OCS_HCU_DMA_MAX_ADDR_MASK (BIT(32) - 1)
^~~~~~~
include/linux/bits.h:8:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^ ~~~~
1 warning generated.
--
>> drivers/crypto/keembay/ocs-hcu.c:389:22: warning: shift count >= width of type [-Wshift-count-overflow]
if (!head || head > OCS_HCU_DMA_MAX_ADDR_MASK)
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/crypto/keembay/ocs-hcu.h:30:36: note: expanded from macro 'OCS_HCU_DMA_MAX_ADDR_MASK'
#define OCS_HCU_DMA_MAX_ADDR_MASK (BIT(32) - 1)
^~~~~~~
include/linux/bits.h:8:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^ ~~~~
drivers/crypto/keembay/ocs-hcu.c:118:19: warning: unused function 'ocs_hcu_digest_size' [-Wunused-function]
static inline u32 ocs_hcu_digest_size(u32 algo)
^
2 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- LOCKDEP && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86
vim +226 drivers/crypto/keembay/keembay-ocs-hcu-core.c
222
223 static int kmb_ocs_add_dma_tail(struct ocs_hcu_rctx *rctx,
224 dma_addr_t addr, size_t len)
225 {
> 226 if (addr & KMB_OCS_HCU_ALIGN_MASK || addr > OCS_HCU_DMA_MAX_ADDR_MASK)
227 return -EINVAL;
228
229 if (!len)
230 return 0;
231
232 rctx->dma_list_tail->src_adr = (u32)addr;
233 rctx->dma_list_tail->src_len = (u32)len;
234 rctx->dma_list_tail->ll_flags = 0;
235 rctx->dma_list_tail->nxt_desc = rctx->ll_dma_addr +
236 (virt_to_phys(rctx->dma_list_tail) -
237 virt_to_phys(rctx->dma_list_head)) +
238 sizeof(*rctx->dma_list_tail);
239
240 rctx->dma_list_tail++;
241
242 return 0;
243 }
244
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v5] platform/x86: acer-wmi: Add Turbo Mode support for Acer PH315-53
by kernel test robot
Hi JafarAkhondali,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.14-rc5 next-20210812]
[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]
url: https://github.com/0day-ci/linux/commits/JafarAkhondali/platform-x86-acer...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1746f4db513563bb22e0ba0c419d0c90912dfae1
config: i386-randconfig-a015-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/292cfa3c9af2eb61b782c6d94d08d3530...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review JafarAkhondali/platform-x86-acer-wmi-Add-Turbo-Mode-support-for-Acer-PH315-53/20210812-212347
git checkout 292cfa3c9af2eb61b782c6d94d08d35300318ca3
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/platform/x86/acer-wmi.c:1466:6: warning: no previous prototype for 'WMID_gaming_set_fan_mode' [-Wmissing-prototypes]
1466 | void WMID_gaming_set_fan_mode(u8 fan_mode)
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/WMID_gaming_set_fan_mode +1466 drivers/platform/x86/acer-wmi.c
1465
> 1466 void WMID_gaming_set_fan_mode(u8 fan_mode)
1467 {
1468 /* fan_mode = 1 is used for auto, fan_mode = 2 used for turbo*/
1469 u64 gpu_fan_config1 = 0, gpu_fan_config2 = 0;
1470 int i;
1471
1472 if (quirks->cpu_fans > 0)
1473 gpu_fan_config2 |= 1;
1474 for (i = 0; i < (quirks->cpu_fans + quirks->gpu_fans); ++i)
1475 gpu_fan_config2 |= 1 << (i + 1);
1476 for (i = 0; i < quirks->gpu_fans; ++i)
1477 gpu_fan_config2 |= 1 << (i + 3);
1478 if (quirks->cpu_fans > 0)
1479 gpu_fan_config1 |= fan_mode;
1480 for (i = 0; i < (quirks->cpu_fans + quirks->gpu_fans); ++i)
1481 gpu_fan_config1 |= fan_mode << (2 * i + 2);
1482 for (i = 0; i < quirks->gpu_fans; ++i)
1483 gpu_fan_config1 |= fan_mode << (2 * i + 6);
1484 WMID_gaming_set_u64(gpu_fan_config2 | gpu_fan_config1 << 16, ACER_CAP_TURBO_FAN);
1485 }
1486
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[dhowells-fs:netfs-folio 3/3] fs/ceph/addr.c:813:4: error: 'page' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio
head: bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e
commit: bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e [3/3] ceph: Use folios
config: arm-randconfig-s031-20210812 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio
git checkout bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash fs/
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 >>):
fs/ceph/addr.c: In function 'writepage_nounlock':
fs/ceph/addr.c:553:2: warning: #warning ^^^ which page? [-Wcpp]
553 | #warning ^^^ which page?
| ^~~~~~~
fs/ceph/addr.c: In function 'writepages_finish':
fs/ceph/addr.c:674:2: warning: #warning ^^^ page or folio? [-Wcpp]
674 | #warning ^^^ page or folio?
| ^~~~~~~
fs/ceph/addr.c: In function 'ceph_writepages_start':
>> fs/ceph/addr.c:813:4: error: 'page' undeclared (first use in this function)
813 | page = pvec.pages[i];
| ^~~~
fs/ceph/addr.c:813:4: note: each undeclared identifier is reported only once for each function it appears in
In file included from fs/ceph/addr.c:2:
>> fs/ceph/addr.c:814:46: error: passing argument 1 of 'folio_index' from incompatible pointer type [-Werror=incompatible-pointer-types]
814 | dout("? %p idx %lu\n", folio, folio_index(folio));
| ^~~~~
| |
| struct page *
include/linux/ceph/ceph_debug.h:26:29: note: in definition of macro 'dout'
26 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:457:49: note: expected 'struct folio *' but argument is of type 'struct page *'
457 | static inline pgoff_t folio_index(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:816:16: error: passing argument 1 of 'folio_lock' from incompatible pointer type [-Werror=incompatible-pointer-types]
816 | folio_lock(folio); /* first page */
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:700:45: note: expected 'struct folio *' but argument is of type 'struct page *'
700 | static inline void folio_lock(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:817:28: error: passing argument 1 of 'folio_trylock' from incompatible pointer type [-Werror=incompatible-pointer-types]
817 | else if (!folio_trylock(folio))
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:687:48: note: expected 'struct folio *' but argument is of type 'struct page *'
687 | static inline bool folio_trylock(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
>> fs/ceph/addr.c:821:35: error: passing argument 1 of 'folio_test_dirty' from incompatible pointer type [-Werror=incompatible-pointer-types]
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~
| |
| struct page *
include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
33 | ______r = __builtin_expect(!!(x), expect); \
| ^
fs/ceph/addr.c:821:8: note: in expansion of macro 'unlikely'
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~~~~
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:313:62: note: expected 'struct folio *' but argument is of type 'struct page *'
313 | static __always_inline bool folio_test_##lname(struct folio *folio) \
| ~~~~~~~~~~~~~~^~~~~
include/linux/page-flags.h:361:2: note: in expansion of macro 'TESTPAGEFLAG'
361 | TESTPAGEFLAG(uname, lname, policy) \
| ^~~~~~~~~~~~
include/linux/page-flags.h:412:1: note: in expansion of macro 'PAGEFLAG'
412 | PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
| ^~~~~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
>> fs/ceph/addr.c:821:35: error: passing argument 1 of 'folio_test_dirty' from incompatible pointer type [-Werror=incompatible-pointer-types]
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~
| |
| struct page *
include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
35 | expect, is_constant); \
| ^~~~~~~~~~~
fs/ceph/addr.c:821:8: note: in expansion of macro 'unlikely'
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~~~~
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:313:62: note: expected 'struct folio *' but argument is of type 'struct page *'
313 | static __always_inline bool folio_test_##lname(struct folio *folio) \
| ~~~~~~~~~~~~~~^~~~~
include/linux/page-flags.h:361:2: note: in expansion of macro 'TESTPAGEFLAG'
361 | TESTPAGEFLAG(uname, lname, policy) \
| ^~~~~~~~~~~~
include/linux/page-flags.h:412:1: note: in expansion of macro 'PAGEFLAG'
412 | PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
| ^~~~~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
>> fs/ceph/addr.c:822:31: error: passing argument 1 of 'folio_mapping' from incompatible pointer type [-Werror=incompatible-pointer-types]
822 | unlikely(folio_mapping(folio) != mapping)) {
| ^~~~~
| |
| struct page *
include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
33 | ______r = __builtin_expect(!!(x), expect); \
| ^
fs/ceph/addr.c:822:8: note: in expansion of macro 'unlikely'
822 | unlikely(folio_mapping(folio) != mapping)) {
| ^~~~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:166:37: note: expected 'struct folio *' but argument is of type 'struct page *'
166 | struct address_space *folio_mapping(struct folio *);
| ^~~~~~~~~~~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
>> fs/ceph/addr.c:822:31: error: passing argument 1 of 'folio_mapping' from incompatible pointer type [-Werror=incompatible-pointer-types]
822 | unlikely(folio_mapping(folio) != mapping)) {
| ^~~~~
| |
| struct page *
include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
35 | expect, is_constant); \
| ^~~~~~~~~~~
fs/ceph/addr.c:822:8: note: in expansion of macro 'unlikely'
822 | unlikely(folio_mapping(folio) != mapping)) {
| ^~~~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:166:37: note: expected 'struct folio *' but argument is of type 'struct page *'
166 | struct address_space *folio_mapping(struct folio *);
| ^~~~~~~~~~~~~~
>> fs/ceph/addr.c:824:18: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
824 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:828:33: error: passing argument 1 of 'folio_snap_context' from incompatible pointer type [-Werror=incompatible-pointer-types]
828 | pgsnapc = folio_snap_context(folio);
| ^~~~~
| |
| struct page *
fs/ceph/addr.c:68:74: note: expected 'struct folio *' but argument is of type 'struct page *'
68 | static inline struct ceph_snap_context *folio_snap_context(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:836:18: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
836 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:839:23: error: passing argument 1 of 'folio_file_pos' from incompatible pointer type [-Werror=incompatible-pointer-types]
839 | if (folio_file_pos(folio) >= ceph_wbc.i_size) {
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:636:51: note: expected 'struct folio *' but argument is of type 'struct page *'
636 | static inline loff_t folio_file_pos(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:843:24: error: passing argument 1 of 'folio_file_pos' from incompatible pointer type [-Werror=incompatible-pointer-types]
843 | folio_file_pos(folio) >= i_size_read(inode)) &&
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:636:51: note: expected 'struct folio *' but argument is of type 'struct page *'
636 | static inline loff_t folio_file_pos(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:846:23: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
846 | 0, folio_size(folio));
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:847:18: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
847 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:850:39: error: passing argument 1 of 'folio_index' from incompatible pointer type [-Werror=incompatible-pointer-types]
850 | if (strip_unit_end && (folio_index(folio) > strip_unit_end)) {
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:457:49: note: expected 'struct folio *' but argument is of type 'struct page *'
457 | static inline pgoff_t folio_index(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:852:18: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
852 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:858:19: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
858 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:867:18: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
867 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:883:34: error: passing argument 1 of 'folio_file_pos' from incompatible pointer type [-Werror=incompatible-pointer-types]
883 | offset = (u64)folio_file_pos(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:636:51: note: expected 'struct folio *' but argument is of type 'struct page *'
636 | static inline loff_t folio_file_pos(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:891:34: error: passing argument 1 of 'folio_index' from incompatible pointer type [-Werror=incompatible-pointer-types]
891 | strip_unit_end = folio_index(folio) +
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:457:49: note: expected 'struct folio *' but argument is of type 'struct page *'
457 | static inline pgoff_t folio_index(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:906:27: error: passing argument 1 of 'folio_index' from incompatible pointer type [-Werror=incompatible-pointer-types]
906 | } else if (folio_index(folio) !=
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:457:49: note: expected 'struct folio *' but argument is of type 'struct page *'
457 | static inline pgoff_t folio_index(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:911:19: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
911 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:916:34: error: passing argument 1 of 'folio_file_pos' from incompatible pointer type [-Werror=incompatible-pointer-types]
916 | offset = (u64)folio_file_pos(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
--
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
fs/ceph/addr.c:984:20: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
984 | folio_size(folio) - offset);
| ^~~~~
| |
| struct page *
include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
33 | ______r = __builtin_expect(!!(x), expect); \
| ^
include/asm-generic/bug.h:65:36: note: in expansion of macro 'unlikely'
65 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
| ^~~~~~~~
fs/ceph/addr.c:983:3: note: in expansion of macro 'BUG_ON'
983 | BUG_ON(len < folio_file_pos(pages[locked_pages - 1]) +
| ^~~~~~
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
fs/ceph/addr.c:983:36: error: passing argument 1 of 'folio_file_pos' from incompatible pointer type [-Werror=incompatible-pointer-types]
983 | BUG_ON(len < folio_file_pos(pages[locked_pages - 1]) +
| ~~~~~^~~~~~~~~~~~~~~~~~
| |
| struct page *
include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
35 | expect, is_constant); \
| ^~~~~~~~~~~
include/asm-generic/bug.h:65:36: note: in expansion of macro 'unlikely'
65 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
| ^~~~~~~~
fs/ceph/addr.c:983:3: note: in expansion of macro 'BUG_ON'
983 | BUG_ON(len < folio_file_pos(pages[locked_pages - 1]) +
| ^~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:636:51: note: expected 'struct folio *' but argument is of type 'struct page *'
636 | static inline loff_t folio_file_pos(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
fs/ceph/addr.c:984:20: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
984 | folio_size(folio) - offset);
| ^~~~~
| |
| struct page *
include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
35 | expect, is_constant); \
| ^~~~~~~~~~~
include/asm-generic/bug.h:65:36: note: in expansion of macro 'unlikely'
65 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
| ^~~~~~~~
fs/ceph/addr.c:983:3: note: in expansion of macro 'BUG_ON'
983 | BUG_ON(len < folio_file_pos(pages[locked_pages - 1]) +
| ^~~~~~
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:1014:22: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
1014 | len += folio_size(folio);
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:1023:39: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
1023 | u64 min_len = len + 1 - folio_size(folio);
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:1024:49: error: passing argument 2 of 'get_writepages_data_length' from incompatible pointer type [-Werror=incompatible-pointer-types]
1024 | len = get_writepages_data_length(inode, pages[i - 1],
| ~~~~~^~~~~~~
| |
| struct page *
fs/ceph/addr.c:456:25: note: expected 'struct folio *' but argument is of type 'struct page *'
456 | struct folio *folio, u64 start)
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:1104:29: error: 'folio' undeclared (first use in this function)
1104 | if (folio_snap_context(folio) != snapc)
| ^~~~~
fs/ceph/addr.c: In function 'ceph_find_incompatible':
fs/ceph/addr.c:1157:38: error: 'folio' undeclared (first use in this function)
1157 | struct inode *inode = folio_mapping(folio)->host;
| ^~~~~
>> fs/ceph/addr.c:1191:31: error: passing argument 1 of 'writepage_nounlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
1191 | int r = writepage_nounlock(page, NULL);
| ^~~~
| |
| struct page *
fs/ceph/addr.c:488:45: note: expected 'struct folio *' but argument is of type 'struct page *'
488 | static int writepage_nounlock(struct folio *folio, struct writeback_control *wbc)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c: In function 'ceph_netfs_check_write_begin':
fs/ceph/addr.c:1206:33: error: 'page' undeclared (first use in this function)
1206 | snapc = ceph_find_incompatible(page);
| ^~~~
fs/ceph/addr.c: In function 'ceph_write_begin':
fs/ceph/addr.c:1253:29: error: 'folio' undeclared (first use in this function)
1253 | if (!folio_test_uptodate(folio)) {
| ^~~~~
>> fs/ceph/addr.c:1261:3: error: implicit declaration of function 'folio_set_uptodate'; did you mean 'folio_test_uptodate'? [-Werror=implicit-function-declaration]
1261 | folio_set_uptodate(folio);
| ^~~~~~~~~~~~~~~~~~
| folio_test_uptodate
fs/ceph/addr.c:1265:61: error: passing argument 6 of 'netfs_write_begin' from incompatible pointer type [-Werror=incompatible-pointer-types]
1265 | r = netfs_write_begin(file, inode->i_mapping, pos, len, 0, &page, NULL,
| ^~~~~
| |
| struct page **
In file included from fs/ceph/addr.c:15:
include/linux/netfs.h:247:45: note: expected 'struct folio **' but argument is of type 'struct page **'
247 | loff_t, unsigned int, unsigned int, struct folio **,
| ^~~~~~~~~~~~~~~
fs/ceph/addr.c: In function 'ceph_filemap_fault':
fs/ceph/addr.c:1419:17: error: 'folio' undeclared (first use in this function)
1419 | folio_unlock(folio);
| ^~~~~
fs/ceph/addr.c: In function 'ceph_page_mkwrite':
fs/ceph/addr.c:1451:30: error: 'folio' undeclared (first use in this function)
1451 | loff_t off = folio_file_pos(folio);
| ^~~~~
fs/ceph/addr.c: In function 'ceph_fill_inline_data':
>> fs/ceph/addr.c:1569:11: error: too many arguments to function 'filemap_get_folio'
1569 | folio = filemap_get_folio(mapping, 0,
| ^~~~~~~~~~~~~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:340:29: note: declared here
340 | static inline struct folio *filemap_get_folio(struct address_space *mapping,
| ^~~~~~~~~~~~~~~~~
>> fs/ceph/addr.c:1569:9: error: assignment to 'struct page *' from incompatible pointer type 'struct folio *' [-Werror=incompatible-pointer-types]
1569 | folio = filemap_get_folio(mapping, 0,
| ^
>> fs/ceph/addr.c:1575:27: error: passing argument 1 of 'folio_test_uptodate' from incompatible pointer type [-Werror=incompatible-pointer-types]
1575 | if (folio_test_uptodate(folio)) {
| ^~~~~
| |
| struct page *
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:607:54: note: expected 'struct folio *' but argument is of type 'struct page *'
607 | static inline bool folio_test_uptodate(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:1576:17: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
1576 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> fs/ceph/addr.c:1577:14: error: passing argument 1 of 'folio_put' from incompatible pointer type [-Werror=incompatible-pointer-types]
1577 | folio_put(folio);
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1265:44: note: expected 'struct folio *' but argument is of type 'struct page *'
1265 | static inline void folio_put(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
In file included from fs/ceph/addr.c:2:
fs/ceph/addr.c:1583:38: error: 'locked_page' undeclared (first use in this function); did you mean 'lock_page'?
1583 | inode, ceph_vinop(inode), len, locked_page);
| ^~~~~~~~~~~
include/linux/ceph/ceph_debug.h:26:29: note: in definition of macro 'dout'
26 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
fs/ceph/addr.c:1586:29: error: 'page' undeclared (first use in this function)
1586 | void *kaddr = kmap_atomic(page);
| ^~~~
fs/ceph/addr.c:1592:24: error: passing argument 1 of 'folio_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
1592 | if (len < folio_size(folio))
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1721:47: note: expected 'struct folio *' but argument is of type 'struct page *'
1721 | static inline size_t folio_size(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:1598:16: error: passing argument 1 of 'folio_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
1598 | folio_unlock(folio);
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:685:33: note: expected 'struct folio *' but argument is of type 'struct page *'
685 | void folio_unlock(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:1599:13: error: passing argument 1 of 'folio_put' from incompatible pointer type [-Werror=incompatible-pointer-types]
1599 | folio_put(folio);
| ^~~~~
| |
| struct page *
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from include/linux/backing-dev.h:15,
from fs/ceph/addr.c:4:
include/linux/mm.h:1265:44: note: expected 'struct folio *' but argument is of type 'struct page *'
1265 | static inline void folio_put(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c: At top level:
fs/ceph/addr.c:1603:5: error: conflicting types for 'ceph_uninline_data'
1603 | int ceph_uninline_data(struct file *filp, struct folio *locked_folio)
| ^~~~~~~~~~~~~~~~~~
In file included from fs/ceph/addr.c:17:
fs/ceph/super.h:1193:12: note: previous declaration of 'ceph_uninline_data' was here
1193 | extern int ceph_uninline_data(struct file *filp, struct page *locked_page);
| ^~~~~~~~~~~~~~~~~~
fs/ceph/addr.c: In function 'ceph_uninline_data':
fs/ceph/addr.c:1626:9: error: assignment to 'struct page *' from incompatible pointer type 'struct folio *' [-Werror=incompatible-pointer-types]
1626 | folio = locked_folio;
| ^
In file included from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/preempt.h:5,
from ./arch/arm/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
fs/ceph/addr.c:1627:32: error: passing argument 1 of 'folio_test_uptodate' from incompatible pointer type [-Werror=incompatible-pointer-types]
1627 | WARN_ON(!folio_test_uptodate(folio));
| ^~~~~
| |
| struct page *
include/asm-generic/bug.h:121:25: note: in definition of macro 'WARN_ON'
121 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:607:54: note: expected 'struct folio *' but argument is of type 'struct page *'
vim +/page +813 fs/ceph/addr.c
1d3576fd10f0d7 Sage Weil 2009-10-06 620
1d3576fd10f0d7 Sage Weil 2009-10-06 621 /*
1d3576fd10f0d7 Sage Weil 2009-10-06 622 * async writeback completion handler.
1d3576fd10f0d7 Sage Weil 2009-10-06 623 *
1d3576fd10f0d7 Sage Weil 2009-10-06 624 * If we get an error, set the mapping error bit, but not the individual
1d3576fd10f0d7 Sage Weil 2009-10-06 625 * page error bits.
1d3576fd10f0d7 Sage Weil 2009-10-06 626 */
85e084feb47349 Ilya Dryomov 2016-04-28 627 static void writepages_finish(struct ceph_osd_request *req)
1d3576fd10f0d7 Sage Weil 2009-10-06 628 {
1d3576fd10f0d7 Sage Weil 2009-10-06 629 struct inode *inode = req->r_inode;
1d3576fd10f0d7 Sage Weil 2009-10-06 630 struct ceph_inode_info *ci = ceph_inode(inode);
87060c1089a94f Alex Elder 2013-04-03 631 struct ceph_osd_data *osd_data;
bd62d82fbd1b69 David Howells 2021-08-11 632 struct folio *folio;
5b64640cf65be4 Yan, Zheng 2016-01-07 633 int num_pages, total_pages = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 634 int i, j;
5b64640cf65be4 Yan, Zheng 2016-01-07 635 int rc = req->r_result;
1d3576fd10f0d7 Sage Weil 2009-10-06 636 struct ceph_snap_context *snapc = req->r_snapc;
1d3576fd10f0d7 Sage Weil 2009-10-06 637 struct address_space *mapping = inode->i_mapping;
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 638 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
903f4fec78dd05 Xiubo Li 2021-05-13 639 unsigned int len = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 640 bool remove_page;
5b64640cf65be4 Yan, Zheng 2016-01-07 641
5b64640cf65be4 Yan, Zheng 2016-01-07 642 dout("writepages_finish %p rc %d\n", inode, rc);
26544c623e741a Jeff Layton 2017-04-04 643 if (rc < 0) {
5b64640cf65be4 Yan, Zheng 2016-01-07 644 mapping_set_error(mapping, rc);
26544c623e741a Jeff Layton 2017-04-04 645 ceph_set_error_write(ci);
0b98acd6188309 Ilya Dryomov 2020-09-14 646 if (rc == -EBLOCKLISTED)
0b98acd6188309 Ilya Dryomov 2020-09-14 647 fsc->blocklisted = true;
26544c623e741a Jeff Layton 2017-04-04 648 } else {
26544c623e741a Jeff Layton 2017-04-04 649 ceph_clear_error_write(ci);
26544c623e741a Jeff Layton 2017-04-04 650 }
1d3576fd10f0d7 Sage Weil 2009-10-06 651
79788c698b2904 Sage Weil 2010-02-02 652 /*
5b64640cf65be4 Yan, Zheng 2016-01-07 653 * We lost the cache cap, need to truncate the page before
5b64640cf65be4 Yan, Zheng 2016-01-07 654 * it is unlocked, otherwise we'd truncate it later in the
5b64640cf65be4 Yan, Zheng 2016-01-07 655 * page truncation thread, possibly losing some data that
5b64640cf65be4 Yan, Zheng 2016-01-07 656 * raced its way in
79788c698b2904 Sage Weil 2010-02-02 657 */
5b64640cf65be4 Yan, Zheng 2016-01-07 658 remove_page = !(ceph_caps_issued(ci) &
5b64640cf65be4 Yan, Zheng 2016-01-07 659 (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO));
1d3576fd10f0d7 Sage Weil 2009-10-06 660
1d3576fd10f0d7 Sage Weil 2009-10-06 661 /* clean all pages */
5b64640cf65be4 Yan, Zheng 2016-01-07 662 for (i = 0; i < req->r_num_ops; i++) {
5b64640cf65be4 Yan, Zheng 2016-01-07 663 if (req->r_ops[i].op != CEPH_OSD_OP_WRITE)
5b64640cf65be4 Yan, Zheng 2016-01-07 664 break;
5b64640cf65be4 Yan, Zheng 2016-01-07 665
5b64640cf65be4 Yan, Zheng 2016-01-07 666 osd_data = osd_req_op_extent_osd_data(req, i);
5b64640cf65be4 Yan, Zheng 2016-01-07 667 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES);
903f4fec78dd05 Xiubo Li 2021-05-13 668 len += osd_data->length;
5b64640cf65be4 Yan, Zheng 2016-01-07 669 num_pages = calc_pages_for((u64)osd_data->alignment,
5b64640cf65be4 Yan, Zheng 2016-01-07 670 (u64)osd_data->length);
5b64640cf65be4 Yan, Zheng 2016-01-07 671 total_pages += num_pages;
5b64640cf65be4 Yan, Zheng 2016-01-07 672 for (j = 0; j < num_pages; j++) {
bd62d82fbd1b69 David Howells 2021-08-11 673 folio = page_folio(osd_data->pages[j]);
bd62d82fbd1b69 David Howells 2021-08-11 @674 #warning ^^^ page or folio?
bd62d82fbd1b69 David Howells 2021-08-11 675 BUG_ON(!folio);
bd62d82fbd1b69 David Howells 2021-08-11 676 WARN_ON(!folio_test_uptodate(folio));
1d3576fd10f0d7 Sage Weil 2009-10-06 677
5b64640cf65be4 Yan, Zheng 2016-01-07 678 if (atomic_long_dec_return(&fsc->writeback_count) <
5b64640cf65be4 Yan, Zheng 2016-01-07 679 CONGESTION_OFF_THRESH(
5b64640cf65be4 Yan, Zheng 2016-01-07 680 fsc->mount_options->congestion_kb))
09dc9fc24ba714 Jan Kara 2017-04-12 681 clear_bdi_congested(inode_to_bdi(inode),
2baba25019ec56 Yehuda Sadeh 2009-12-18 682 BLK_RW_ASYNC);
2baba25019ec56 Yehuda Sadeh 2009-12-18 683
bd62d82fbd1b69 David Howells 2021-08-11 684 ceph_put_snap_context(folio_detach_private(folio));
bd62d82fbd1b69 David Howells 2021-08-11 685 folio_end_writeback(folio);
bd62d82fbd1b69 David Howells 2021-08-11 686 dout("unlocking %p\n", folio);
e63dc5c780ba32 Yehuda Sadeh 2010-02-19 687
5b64640cf65be4 Yan, Zheng 2016-01-07 688 if (remove_page)
5b64640cf65be4 Yan, Zheng 2016-01-07 689 generic_error_remove_page(inode->i_mapping,
bd62d82fbd1b69 David Howells 2021-08-11 690 &folio->page);
e63dc5c780ba32 Yehuda Sadeh 2010-02-19 691
bd62d82fbd1b69 David Howells 2021-08-11 692 folio_unlock(folio);
1d3576fd10f0d7 Sage Weil 2009-10-06 693 }
5b64640cf65be4 Yan, Zheng 2016-01-07 694 dout("writepages_finish %p wrote %llu bytes cleaned %d pages\n",
5b64640cf65be4 Yan, Zheng 2016-01-07 695 inode, osd_data->length, rc >= 0 ? num_pages : 0);
1d3576fd10f0d7 Sage Weil 2009-10-06 696
96ac9158a230e4 John Hubbard 2019-08-08 697 release_pages(osd_data->pages, num_pages);
5b64640cf65be4 Yan, Zheng 2016-01-07 698 }
5b64640cf65be4 Yan, Zheng 2016-01-07 699
903f4fec78dd05 Xiubo Li 2021-05-13 700 ceph_update_write_metrics(&fsc->mdsc->metric, req->r_start_latency,
903f4fec78dd05 Xiubo Li 2021-05-13 701 req->r_end_latency, len, rc);
903f4fec78dd05 Xiubo Li 2021-05-13 702
5b64640cf65be4 Yan, Zheng 2016-01-07 703 ceph_put_wrbuffer_cap_refs(ci, total_pages, snapc);
5b64640cf65be4 Yan, Zheng 2016-01-07 704
5b64640cf65be4 Yan, Zheng 2016-01-07 705 osd_data = osd_req_op_extent_osd_data(req, 0);
87060c1089a94f Alex Elder 2013-04-03 706 if (osd_data->pages_from_pool)
a0102bda5bc099 Jeff Layton 2020-07-30 707 mempool_free(osd_data->pages, ceph_wb_pagevec_pool);
1d3576fd10f0d7 Sage Weil 2009-10-06 708 else
87060c1089a94f Alex Elder 2013-04-03 709 kfree(osd_data->pages);
1d3576fd10f0d7 Sage Weil 2009-10-06 710 ceph_osdc_put_request(req);
1d3576fd10f0d7 Sage Weil 2009-10-06 711 }
1d3576fd10f0d7 Sage Weil 2009-10-06 712
1d3576fd10f0d7 Sage Weil 2009-10-06 713 /*
1d3576fd10f0d7 Sage Weil 2009-10-06 714 * initiate async writeback
1d3576fd10f0d7 Sage Weil 2009-10-06 715 */
1d3576fd10f0d7 Sage Weil 2009-10-06 716 static int ceph_writepages_start(struct address_space *mapping,
1d3576fd10f0d7 Sage Weil 2009-10-06 717 struct writeback_control *wbc)
1d3576fd10f0d7 Sage Weil 2009-10-06 718 {
1d3576fd10f0d7 Sage Weil 2009-10-06 719 struct inode *inode = mapping->host;
1d3576fd10f0d7 Sage Weil 2009-10-06 720 struct ceph_inode_info *ci = ceph_inode(inode);
fc2744aa12da71 Yan, Zheng 2013-05-31 721 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
fc2744aa12da71 Yan, Zheng 2013-05-31 722 struct ceph_vino vino = ceph_vino(inode);
2a2d927e35dd8d Yan, Zheng 2017-09-01 723 pgoff_t index, start_index, end = -1;
80e755fedebc8d Sage Weil 2010-03-31 724 struct ceph_snap_context *snapc = NULL, *last_snapc = NULL, *pgsnapc;
1d3576fd10f0d7 Sage Weil 2009-10-06 725 struct pagevec pvec;
1d3576fd10f0d7 Sage Weil 2009-10-06 726 int rc = 0;
93407472a21b82 Fabian Frederick 2017-02-27 727 unsigned int wsize = i_blocksize(inode);
1d3576fd10f0d7 Sage Weil 2009-10-06 728 struct ceph_osd_request *req = NULL;
1f934b00e90752 Yan, Zheng 2017-08-30 729 struct ceph_writeback_ctl ceph_wbc;
590e9d9861f5f2 Yan, Zheng 2017-09-03 730 bool should_loop, range_whole = false;
af9cc401ce7452 Yan, Zheng 2018-03-04 731 bool done = false;
1d3576fd10f0d7 Sage Weil 2009-10-06 732
3fb99d483e614b Yanhu Cao 2017-07-21 733 dout("writepages_start %p (mode=%s)\n", inode,
1d3576fd10f0d7 Sage Weil 2009-10-06 734 wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
1d3576fd10f0d7 Sage Weil 2009-10-06 735 (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));
1d3576fd10f0d7 Sage Weil 2009-10-06 736
50c9132ddfb202 Jeff Layton 2020-09-25 737 if (READ_ONCE(fsc->mount_state) >= CEPH_MOUNT_SHUTDOWN) {
6c93df5db628e7 Yan, Zheng 2016-04-15 738 if (ci->i_wrbuffer_ref > 0) {
6c93df5db628e7 Yan, Zheng 2016-04-15 739 pr_warn_ratelimited(
6c93df5db628e7 Yan, Zheng 2016-04-15 740 "writepage_start %p %lld forced umount\n",
6c93df5db628e7 Yan, Zheng 2016-04-15 741 inode, ceph_ino(inode));
6c93df5db628e7 Yan, Zheng 2016-04-15 742 }
a341d4df87487a Yan, Zheng 2015-07-01 743 mapping_set_error(mapping, -EIO);
1d3576fd10f0d7 Sage Weil 2009-10-06 744 return -EIO; /* we're in a forced umount, don't write! */
1d3576fd10f0d7 Sage Weil 2009-10-06 745 }
95cca2b44e54b0 Yan, Zheng 2017-07-11 746 if (fsc->mount_options->wsize < wsize)
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 747 wsize = fsc->mount_options->wsize;
1d3576fd10f0d7 Sage Weil 2009-10-06 748
8667982014d604 Mel Gorman 2017-11-15 749 pagevec_init(&pvec);
1d3576fd10f0d7 Sage Weil 2009-10-06 750
590e9d9861f5f2 Yan, Zheng 2017-09-03 751 start_index = wbc->range_cyclic ? mapping->writeback_index : 0;
590e9d9861f5f2 Yan, Zheng 2017-09-03 752 index = start_index;
1d3576fd10f0d7 Sage Weil 2009-10-06 753
1d3576fd10f0d7 Sage Weil 2009-10-06 754 retry:
1d3576fd10f0d7 Sage Weil 2009-10-06 755 /* find oldest snap context with dirty data */
05455e1177f768 Yan, Zheng 2017-09-02 756 snapc = get_oldest_context(inode, &ceph_wbc, NULL);
1d3576fd10f0d7 Sage Weil 2009-10-06 757 if (!snapc) {
1d3576fd10f0d7 Sage Weil 2009-10-06 758 /* hmm, why does writepages get called when there
1d3576fd10f0d7 Sage Weil 2009-10-06 759 is no dirty data? */
1d3576fd10f0d7 Sage Weil 2009-10-06 760 dout(" no snap context with dirty data?\n");
1d3576fd10f0d7 Sage Weil 2009-10-06 761 goto out;
1d3576fd10f0d7 Sage Weil 2009-10-06 762 }
1d3576fd10f0d7 Sage Weil 2009-10-06 763 dout(" oldest snapc is %p seq %lld (%d snaps)\n",
1d3576fd10f0d7 Sage Weil 2009-10-06 764 snapc, snapc->seq, snapc->num_snaps);
fc2744aa12da71 Yan, Zheng 2013-05-31 765
2a2d927e35dd8d Yan, Zheng 2017-09-01 766 should_loop = false;
2a2d927e35dd8d Yan, Zheng 2017-09-01 767 if (ceph_wbc.head_snapc && snapc != last_snapc) {
2a2d927e35dd8d Yan, Zheng 2017-09-01 768 /* where to start/end? */
2a2d927e35dd8d Yan, Zheng 2017-09-01 769 if (wbc->range_cyclic) {
2a2d927e35dd8d Yan, Zheng 2017-09-01 770 index = start_index;
2a2d927e35dd8d Yan, Zheng 2017-09-01 771 end = -1;
2a2d927e35dd8d Yan, Zheng 2017-09-01 772 if (index > 0)
2a2d927e35dd8d Yan, Zheng 2017-09-01 773 should_loop = true;
2a2d927e35dd8d Yan, Zheng 2017-09-01 774 dout(" cyclic, start at %lu\n", index);
2a2d927e35dd8d Yan, Zheng 2017-09-01 775 } else {
2a2d927e35dd8d Yan, Zheng 2017-09-01 776 index = wbc->range_start >> PAGE_SHIFT;
2a2d927e35dd8d Yan, Zheng 2017-09-01 777 end = wbc->range_end >> PAGE_SHIFT;
2a2d927e35dd8d Yan, Zheng 2017-09-01 778 if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
2a2d927e35dd8d Yan, Zheng 2017-09-01 779 range_whole = true;
2a2d927e35dd8d Yan, Zheng 2017-09-01 780 dout(" not cyclic, %lu to %lu\n", index, end);
2a2d927e35dd8d Yan, Zheng 2017-09-01 781 }
2a2d927e35dd8d Yan, Zheng 2017-09-01 782 } else if (!ceph_wbc.head_snapc) {
2a2d927e35dd8d Yan, Zheng 2017-09-01 783 /* Do not respect wbc->range_{start,end}. Dirty pages
2a2d927e35dd8d Yan, Zheng 2017-09-01 784 * in that range can be associated with newer snapc.
2a2d927e35dd8d Yan, Zheng 2017-09-01 785 * They are not writeable until we write all dirty pages
2a2d927e35dd8d Yan, Zheng 2017-09-01 786 * associated with 'snapc' get written */
1582af2eaaf17c Yan, Zheng 2018-03-06 787 if (index > 0)
2a2d927e35dd8d Yan, Zheng 2017-09-01 788 should_loop = true;
2a2d927e35dd8d Yan, Zheng 2017-09-01 789 dout(" non-head snapc, range whole\n");
1d3576fd10f0d7 Sage Weil 2009-10-06 790 }
2a2d927e35dd8d Yan, Zheng 2017-09-01 791
2a2d927e35dd8d Yan, Zheng 2017-09-01 792 ceph_put_snap_context(last_snapc);
1d3576fd10f0d7 Sage Weil 2009-10-06 793 last_snapc = snapc;
1d3576fd10f0d7 Sage Weil 2009-10-06 794
af9cc401ce7452 Yan, Zheng 2018-03-04 795 while (!done && index <= end) {
5b64640cf65be4 Yan, Zheng 2016-01-07 796 int num_ops = 0, op_idx;
0e5ecac7168366 Yan, Zheng 2017-08-31 797 unsigned i, pvec_pages, max_pages, locked_pages = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 798 struct page **pages = NULL, **data_pages;
bd62d82fbd1b69 David Howells 2021-08-11 799 struct page *folio;
0e5ecac7168366 Yan, Zheng 2017-08-31 800 pgoff_t strip_unit_end = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 801 u64 offset = 0, len = 0;
a0102bda5bc099 Jeff Layton 2020-07-30 802 bool from_pool = false;
1d3576fd10f0d7 Sage Weil 2009-10-06 803
0e5ecac7168366 Yan, Zheng 2017-08-31 804 max_pages = wsize >> PAGE_SHIFT;
1d3576fd10f0d7 Sage Weil 2009-10-06 805
1d3576fd10f0d7 Sage Weil 2009-10-06 806 get_more_pages:
2e169296603470 Jeff Layton 2020-09-14 807 pvec_pages = pagevec_lookup_range_tag(&pvec, mapping, &index,
2e169296603470 Jeff Layton 2020-09-14 808 end, PAGECACHE_TAG_DIRTY);
0ed75fc8d288f4 Jan Kara 2017-11-15 809 dout("pagevec_lookup_range_tag got %d\n", pvec_pages);
1d3576fd10f0d7 Sage Weil 2009-10-06 810 if (!pvec_pages && !locked_pages)
1d3576fd10f0d7 Sage Weil 2009-10-06 811 break;
1d3576fd10f0d7 Sage Weil 2009-10-06 812 for (i = 0; i < pvec_pages && locked_pages < max_pages; i++) {
1d3576fd10f0d7 Sage Weil 2009-10-06 @813 page = pvec.pages[i];
bd62d82fbd1b69 David Howells 2021-08-11 @814 dout("? %p idx %lu\n", folio, folio_index(folio));
1d3576fd10f0d7 Sage Weil 2009-10-06 815 if (locked_pages == 0)
bd62d82fbd1b69 David Howells 2021-08-11 @816 folio_lock(folio); /* first page */
bd62d82fbd1b69 David Howells 2021-08-11 @817 else if (!folio_trylock(folio))
1d3576fd10f0d7 Sage Weil 2009-10-06 818 break;
1d3576fd10f0d7 Sage Weil 2009-10-06 819
1d3576fd10f0d7 Sage Weil 2009-10-06 820 /* only dirty pages, or our accounting breaks */
bd62d82fbd1b69 David Howells 2021-08-11 @821 if (unlikely(!folio_test_dirty(folio)) ||
bd62d82fbd1b69 David Howells 2021-08-11 @822 unlikely(folio_mapping(folio) != mapping)) {
1d3576fd10f0d7 Sage Weil 2009-10-06 823 dout("!dirty or !mapping %p\n", page);
bd62d82fbd1b69 David Howells 2021-08-11 @824 folio_unlock(folio);
0713e5f24b7deb Yan, Zheng 2017-08-31 825 continue;
1d3576fd10f0d7 Sage Weil 2009-10-06 826 }
af9cc401ce7452 Yan, Zheng 2018-03-04 827 /* only if matching snap context */
bd62d82fbd1b69 David Howells 2021-08-11 @828 pgsnapc = folio_snap_context(folio);
af9cc401ce7452 Yan, Zheng 2018-03-04 829 if (pgsnapc != snapc) {
af9cc401ce7452 Yan, Zheng 2018-03-04 830 dout("page snapc %p %lld != oldest %p %lld\n",
af9cc401ce7452 Yan, Zheng 2018-03-04 831 pgsnapc, pgsnapc->seq, snapc, snapc->seq);
1582af2eaaf17c Yan, Zheng 2018-03-06 832 if (!should_loop &&
1582af2eaaf17c Yan, Zheng 2018-03-06 833 !ceph_wbc.head_snapc &&
1582af2eaaf17c Yan, Zheng 2018-03-06 834 wbc->sync_mode != WB_SYNC_NONE)
1582af2eaaf17c Yan, Zheng 2018-03-06 835 should_loop = true;
bd62d82fbd1b69 David Howells 2021-08-11 @836 folio_unlock(folio);
af9cc401ce7452 Yan, Zheng 2018-03-04 837 continue;
1d3576fd10f0d7 Sage Weil 2009-10-06 838 }
bd62d82fbd1b69 David Howells 2021-08-11 @839 if (folio_file_pos(folio) >= ceph_wbc.i_size) {
1f934b00e90752 Yan, Zheng 2017-08-30 840 dout("%p page eof %llu\n",
1f934b00e90752 Yan, Zheng 2017-08-30 841 page, ceph_wbc.i_size);
c95f1c5f436bad Erqi Chen 2019-07-24 842 if ((ceph_wbc.size_stable ||
bd62d82fbd1b69 David Howells 2021-08-11 @843 folio_file_pos(folio) >= i_size_read(inode)) &&
c95f1c5f436bad Erqi Chen 2019-07-24 844 clear_page_dirty_for_io(page))
af9cc401ce7452 Yan, Zheng 2018-03-04 845 mapping->a_ops->invalidatepage(page,
bd62d82fbd1b69 David Howells 2021-08-11 @846 0, folio_size(folio));
bd62d82fbd1b69 David Howells 2021-08-11 847 folio_unlock(folio);
af9cc401ce7452 Yan, Zheng 2018-03-04 848 continue;
af9cc401ce7452 Yan, Zheng 2018-03-04 849 }
bd62d82fbd1b69 David Howells 2021-08-11 850 if (strip_unit_end && (folio_index(folio) > strip_unit_end)) {
af9cc401ce7452 Yan, Zheng 2018-03-04 851 dout("end of strip unit %p\n", page);
bd62d82fbd1b69 David Howells 2021-08-11 852 folio_unlock(folio);
1d3576fd10f0d7 Sage Weil 2009-10-06 853 break;
1d3576fd10f0d7 Sage Weil 2009-10-06 854 }
1d3576fd10f0d7 Sage Weil 2009-10-06 855 if (PageWriteback(page)) {
0713e5f24b7deb Yan, Zheng 2017-08-31 856 if (wbc->sync_mode == WB_SYNC_NONE) {
1d3576fd10f0d7 Sage Weil 2009-10-06 857 dout("%p under writeback\n", page);
bd62d82fbd1b69 David Howells 2021-08-11 858 folio_unlock(folio);
0713e5f24b7deb Yan, Zheng 2017-08-31 859 continue;
0713e5f24b7deb Yan, Zheng 2017-08-31 860 }
0713e5f24b7deb Yan, Zheng 2017-08-31 861 dout("waiting on writeback %p\n", page);
0713e5f24b7deb Yan, Zheng 2017-08-31 862 wait_on_page_writeback(page);
1d3576fd10f0d7 Sage Weil 2009-10-06 863 }
1d3576fd10f0d7 Sage Weil 2009-10-06 864
1d3576fd10f0d7 Sage Weil 2009-10-06 865 if (!clear_page_dirty_for_io(page)) {
1d3576fd10f0d7 Sage Weil 2009-10-06 866 dout("%p !clear_page_dirty_for_io\n", page);
bd62d82fbd1b69 David Howells 2021-08-11 867 folio_unlock(folio);
0713e5f24b7deb Yan, Zheng 2017-08-31 868 continue;
1d3576fd10f0d7 Sage Weil 2009-10-06 869 }
1d3576fd10f0d7 Sage Weil 2009-10-06 870
e5975c7c8eb6ae Alex Elder 2013-03-14 871 /*
e5975c7c8eb6ae Alex Elder 2013-03-14 872 * We have something to write. If this is
e5975c7c8eb6ae Alex Elder 2013-03-14 873 * the first locked page this time through,
5b64640cf65be4 Yan, Zheng 2016-01-07 874 * calculate max possinle write size and
5b64640cf65be4 Yan, Zheng 2016-01-07 875 * allocate a page array
e5975c7c8eb6ae Alex Elder 2013-03-14 876 */
1d3576fd10f0d7 Sage Weil 2009-10-06 877 if (locked_pages == 0) {
5b64640cf65be4 Yan, Zheng 2016-01-07 878 u64 objnum;
5b64640cf65be4 Yan, Zheng 2016-01-07 879 u64 objoff;
dccbf08005df80 Ilya Dryomov 2018-02-17 880 u32 xlen;
5b64640cf65be4 Yan, Zheng 2016-01-07 881
1d3576fd10f0d7 Sage Weil 2009-10-06 882 /* prepare async write request */
bd62d82fbd1b69 David Howells 2021-08-11 883 offset = (u64)folio_file_pos(folio);
dccbf08005df80 Ilya Dryomov 2018-02-17 884 ceph_calc_file_object_mapping(&ci->i_layout,
dccbf08005df80 Ilya Dryomov 2018-02-17 885 offset, wsize,
5b64640cf65be4 Yan, Zheng 2016-01-07 886 &objnum, &objoff,
dccbf08005df80 Ilya Dryomov 2018-02-17 887 &xlen);
dccbf08005df80 Ilya Dryomov 2018-02-17 888 len = xlen;
8c71897be2ddfd Henry C Chang 2011-05-03 889
3fb99d483e614b Yanhu Cao 2017-07-21 890 num_ops = 1;
bd62d82fbd1b69 David Howells 2021-08-11 891 strip_unit_end = folio_index(folio) +
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 892 ((len - 1) >> PAGE_SHIFT);
88486957f9fbf5 Alex Elder 2013-03-14 893
5b64640cf65be4 Yan, Zheng 2016-01-07 894 BUG_ON(pages);
88486957f9fbf5 Alex Elder 2013-03-14 895 max_pages = calc_pages_for(0, (u64)len);
6da2ec56059c3c Kees Cook 2018-06-12 896 pages = kmalloc_array(max_pages,
6da2ec56059c3c Kees Cook 2018-06-12 897 sizeof(*pages),
fc2744aa12da71 Yan, Zheng 2013-05-31 898 GFP_NOFS);
88486957f9fbf5 Alex Elder 2013-03-14 899 if (!pages) {
a0102bda5bc099 Jeff Layton 2020-07-30 900 from_pool = true;
a0102bda5bc099 Jeff Layton 2020-07-30 901 pages = mempool_alloc(ceph_wb_pagevec_pool, GFP_NOFS);
e5975c7c8eb6ae Alex Elder 2013-03-14 902 BUG_ON(!pages);
88486957f9fbf5 Alex Elder 2013-03-14 903 }
5b64640cf65be4 Yan, Zheng 2016-01-07 904
5b64640cf65be4 Yan, Zheng 2016-01-07 905 len = 0;
bd62d82fbd1b69 David Howells 2021-08-11 906 } else if (folio_index(folio) !=
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 907 (offset + len) >> PAGE_SHIFT) {
a0102bda5bc099 Jeff Layton 2020-07-30 908 if (num_ops >= (from_pool ? CEPH_OSD_SLAB_OPS :
5b64640cf65be4 Yan, Zheng 2016-01-07 909 CEPH_OSD_MAX_OPS)) {
5b64640cf65be4 Yan, Zheng 2016-01-07 910 redirty_page_for_writepage(wbc, page);
bd62d82fbd1b69 David Howells 2021-08-11 911 folio_unlock(folio);
5b64640cf65be4 Yan, Zheng 2016-01-07 912 break;
5b64640cf65be4 Yan, Zheng 2016-01-07 913 }
5b64640cf65be4 Yan, Zheng 2016-01-07 914
5b64640cf65be4 Yan, Zheng 2016-01-07 915 num_ops++;
bd62d82fbd1b69 David Howells 2021-08-11 916 offset = (u64)folio_file_pos(folio);
5b64640cf65be4 Yan, Zheng 2016-01-07 917 len = 0;
1d3576fd10f0d7 Sage Weil 2009-10-06 918 }
1d3576fd10f0d7 Sage Weil 2009-10-06 919
1d3576fd10f0d7 Sage Weil 2009-10-06 920 /* note position of first page in pvec */
1d3576fd10f0d7 Sage Weil 2009-10-06 921 dout("%p will write page %p idx %lu\n",
bd62d82fbd1b69 David Howells 2021-08-11 922 inode, page, folio_index(folio));
2baba25019ec56 Yehuda Sadeh 2009-12-18 923
5b64640cf65be4 Yan, Zheng 2016-01-07 924 if (atomic_long_inc_return(&fsc->writeback_count) >
5b64640cf65be4 Yan, Zheng 2016-01-07 925 CONGESTION_ON_THRESH(
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 926 fsc->mount_options->congestion_kb)) {
09dc9fc24ba714 Jan Kara 2017-04-12 927 set_bdi_congested(inode_to_bdi(inode),
213c99ee0cf17f Sage Weil 2010-08-03 928 BLK_RW_ASYNC);
2baba25019ec56 Yehuda Sadeh 2009-12-18 929 }
2baba25019ec56 Yehuda Sadeh 2009-12-18 930
0713e5f24b7deb Yan, Zheng 2017-08-31 931
0713e5f24b7deb Yan, Zheng 2017-08-31 932 pages[locked_pages++] = page;
0713e5f24b7deb Yan, Zheng 2017-08-31 933 pvec.pages[i] = NULL;
0713e5f24b7deb Yan, Zheng 2017-08-31 934
bd62d82fbd1b69 David Howells 2021-08-11 935 len += folio_size(folio);
1d3576fd10f0d7 Sage Weil 2009-10-06 936 }
1d3576fd10f0d7 Sage Weil 2009-10-06 937
1d3576fd10f0d7 Sage Weil 2009-10-06 938 /* did we get anything? */
1d3576fd10f0d7 Sage Weil 2009-10-06 939 if (!locked_pages)
1d3576fd10f0d7 Sage Weil 2009-10-06 940 goto release_pvec_pages;
1d3576fd10f0d7 Sage Weil 2009-10-06 941 if (i) {
0713e5f24b7deb Yan, Zheng 2017-08-31 942 unsigned j, n = 0;
0713e5f24b7deb Yan, Zheng 2017-08-31 943 /* shift unused page to beginning of pvec */
0713e5f24b7deb Yan, Zheng 2017-08-31 944 for (j = 0; j < pvec_pages; j++) {
0713e5f24b7deb Yan, Zheng 2017-08-31 945 if (!pvec.pages[j])
0713e5f24b7deb Yan, Zheng 2017-08-31 946 continue;
0713e5f24b7deb Yan, Zheng 2017-08-31 947 if (n < j)
0713e5f24b7deb Yan, Zheng 2017-08-31 948 pvec.pages[n] = pvec.pages[j];
0713e5f24b7deb Yan, Zheng 2017-08-31 949 n++;
0713e5f24b7deb Yan, Zheng 2017-08-31 950 }
0713e5f24b7deb Yan, Zheng 2017-08-31 951 pvec.nr = n;
1d3576fd10f0d7 Sage Weil 2009-10-06 952
1d3576fd10f0d7 Sage Weil 2009-10-06 953 if (pvec_pages && i == pvec_pages &&
1d3576fd10f0d7 Sage Weil 2009-10-06 954 locked_pages < max_pages) {
1d3576fd10f0d7 Sage Weil 2009-10-06 955 dout("reached end pvec, trying for more\n");
0713e5f24b7deb Yan, Zheng 2017-08-31 956 pagevec_release(&pvec);
1d3576fd10f0d7 Sage Weil 2009-10-06 957 goto get_more_pages;
1d3576fd10f0d7 Sage Weil 2009-10-06 958 }
1d3576fd10f0d7 Sage Weil 2009-10-06 959 }
1d3576fd10f0d7 Sage Weil 2009-10-06 960
5b64640cf65be4 Yan, Zheng 2016-01-07 961 new_request:
bd62d82fbd1b69 David Howells 2021-08-11 962 offset = folio_file_pos(pages[0]);
5b64640cf65be4 Yan, Zheng 2016-01-07 963 len = wsize;
5b64640cf65be4 Yan, Zheng 2016-01-07 964
5b64640cf65be4 Yan, Zheng 2016-01-07 965 req = ceph_osdc_new_request(&fsc->client->osdc,
5b64640cf65be4 Yan, Zheng 2016-01-07 966 &ci->i_layout, vino,
5b64640cf65be4 Yan, Zheng 2016-01-07 967 offset, &len, 0, num_ops,
1f934b00e90752 Yan, Zheng 2017-08-30 968 CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE,
1f934b00e90752 Yan, Zheng 2017-08-30 969 snapc, ceph_wbc.truncate_seq,
1f934b00e90752 Yan, Zheng 2017-08-30 970 ceph_wbc.truncate_size, false);
5b64640cf65be4 Yan, Zheng 2016-01-07 971 if (IS_ERR(req)) {
5b64640cf65be4 Yan, Zheng 2016-01-07 972 req = ceph_osdc_new_request(&fsc->client->osdc,
5b64640cf65be4 Yan, Zheng 2016-01-07 973 &ci->i_layout, vino,
5b64640cf65be4 Yan, Zheng 2016-01-07 974 offset, &len, 0,
5b64640cf65be4 Yan, Zheng 2016-01-07 975 min(num_ops,
5b64640cf65be4 Yan, Zheng 2016-01-07 976 CEPH_OSD_SLAB_OPS),
5b64640cf65be4 Yan, Zheng 2016-01-07 977 CEPH_OSD_OP_WRITE,
54ea0046b6fe36 Ilya Dryomov 2017-02-11 978 CEPH_OSD_FLAG_WRITE,
1f934b00e90752 Yan, Zheng 2017-08-30 979 snapc, ceph_wbc.truncate_seq,
1f934b00e90752 Yan, Zheng 2017-08-30 980 ceph_wbc.truncate_size, true);
5b64640cf65be4 Yan, Zheng 2016-01-07 981 BUG_ON(IS_ERR(req));
5b64640cf65be4 Yan, Zheng 2016-01-07 982 }
bd62d82fbd1b69 David Howells 2021-08-11 983 BUG_ON(len < folio_file_pos(pages[locked_pages - 1]) +
bd62d82fbd1b69 David Howells 2021-08-11 984 folio_size(folio) - offset);
5b64640cf65be4 Yan, Zheng 2016-01-07 985
5b64640cf65be4 Yan, Zheng 2016-01-07 986 req->r_callback = writepages_finish;
5b64640cf65be4 Yan, Zheng 2016-01-07 987 req->r_inode = inode;
5b64640cf65be4 Yan, Zheng 2016-01-07 988
5b64640cf65be4 Yan, Zheng 2016-01-07 989 /* Format the osd request message and submit the write */
5b64640cf65be4 Yan, Zheng 2016-01-07 990 len = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 991 data_pages = pages;
5b64640cf65be4 Yan, Zheng 2016-01-07 992 op_idx = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 993 for (i = 0; i < locked_pages; i++) {
5b64640cf65be4 Yan, Zheng 2016-01-07 994 u64 cur_offset = page_offset(pages[i]);
5b64640cf65be4 Yan, Zheng 2016-01-07 995 if (offset + len != cur_offset) {
3fb99d483e614b Yanhu Cao 2017-07-21 996 if (op_idx + 1 == req->r_num_ops)
5b64640cf65be4 Yan, Zheng 2016-01-07 997 break;
5b64640cf65be4 Yan, Zheng 2016-01-07 998 osd_req_op_extent_dup_last(req, op_idx,
5b64640cf65be4 Yan, Zheng 2016-01-07 999 cur_offset - offset);
5b64640cf65be4 Yan, Zheng 2016-01-07 1000 dout("writepages got pages at %llu~%llu\n",
5b64640cf65be4 Yan, Zheng 2016-01-07 1001 offset, len);
5b64640cf65be4 Yan, Zheng 2016-01-07 1002 osd_req_op_extent_osd_data_pages(req, op_idx,
5b64640cf65be4 Yan, Zheng 2016-01-07 1003 data_pages, len, 0,
a0102bda5bc099 Jeff Layton 2020-07-30 1004 from_pool, false);
5b64640cf65be4 Yan, Zheng 2016-01-07 1005 osd_req_op_extent_update(req, op_idx, len);
5b64640cf65be4 Yan, Zheng 2016-01-07 1006
5b64640cf65be4 Yan, Zheng 2016-01-07 1007 len = 0;
5b64640cf65be4 Yan, Zheng 2016-01-07 1008 offset = cur_offset;
5b64640cf65be4 Yan, Zheng 2016-01-07 1009 data_pages = pages + i;
5b64640cf65be4 Yan, Zheng 2016-01-07 1010 op_idx++;
5b64640cf65be4 Yan, Zheng 2016-01-07 1011 }
5b64640cf65be4 Yan, Zheng 2016-01-07 1012
5b64640cf65be4 Yan, Zheng 2016-01-07 1013 set_page_writeback(pages[i]);
bd62d82fbd1b69 David Howells 2021-08-11 1014 len += folio_size(folio);
5b64640cf65be4 Yan, Zheng 2016-01-07 1015 }
5b64640cf65be4 Yan, Zheng 2016-01-07 1016
1f934b00e90752 Yan, Zheng 2017-08-30 1017 if (ceph_wbc.size_stable) {
1f934b00e90752 Yan, Zheng 2017-08-30 1018 len = min(len, ceph_wbc.i_size - offset);
5b64640cf65be4 Yan, Zheng 2016-01-07 1019 } else if (i == locked_pages) {
e1966b49446a43 Yan, Zheng 2015-06-18 1020 /* writepages_finish() clears writeback pages
e1966b49446a43 Yan, Zheng 2015-06-18 1021 * according to the data length, so make sure
e1966b49446a43 Yan, Zheng 2015-06-18 1022 * data length covers all locked pages */
bd62d82fbd1b69 David Howells 2021-08-11 1023 u64 min_len = len + 1 - folio_size(folio);
1f934b00e90752 Yan, Zheng 2017-08-30 1024 len = get_writepages_data_length(inode, pages[i - 1],
1f934b00e90752 Yan, Zheng 2017-08-30 1025 offset);
5b64640cf65be4 Yan, Zheng 2016-01-07 1026 len = max(len, min_len);
e1966b49446a43 Yan, Zheng 2015-06-18 1027 }
5b64640cf65be4 Yan, Zheng 2016-01-07 1028 dout("writepages got pages at %llu~%llu\n", offset, len);
1d3576fd10f0d7 Sage Weil 2009-10-06 1029
5b64640cf65be4 Yan, Zheng 2016-01-07 1030 osd_req_op_extent_osd_data_pages(req, op_idx, data_pages, len,
a0102bda5bc099 Jeff Layton 2020-07-30 1031 0, from_pool, false);
5b64640cf65be4 Yan, Zheng 2016-01-07 1032 osd_req_op_extent_update(req, op_idx, len);
e5975c7c8eb6ae Alex Elder 2013-03-14 1033
5b64640cf65be4 Yan, Zheng 2016-01-07 1034 BUG_ON(op_idx + 1 != req->r_num_ops);
e5975c7c8eb6ae Alex Elder 2013-03-14 1035
a0102bda5bc099 Jeff Layton 2020-07-30 1036 from_pool = false;
5b64640cf65be4 Yan, Zheng 2016-01-07 1037 if (i < locked_pages) {
5b64640cf65be4 Yan, Zheng 2016-01-07 1038 BUG_ON(num_ops <= req->r_num_ops);
5b64640cf65be4 Yan, Zheng 2016-01-07 1039 num_ops -= req->r_num_ops;
5b64640cf65be4 Yan, Zheng 2016-01-07 1040 locked_pages -= i;
5b64640cf65be4 Yan, Zheng 2016-01-07 1041
5b64640cf65be4 Yan, Zheng 2016-01-07 1042 /* allocate new pages array for next request */
5b64640cf65be4 Yan, Zheng 2016-01-07 1043 data_pages = pages;
6da2ec56059c3c Kees Cook 2018-06-12 1044 pages = kmalloc_array(locked_pages, sizeof(*pages),
5b64640cf65be4 Yan, Zheng 2016-01-07 1045 GFP_NOFS);
5b64640cf65be4 Yan, Zheng 2016-01-07 1046 if (!pages) {
a0102bda5bc099 Jeff Layton 2020-07-30 1047 from_pool = true;
a0102bda5bc099 Jeff Layton 2020-07-30 1048 pages = mempool_alloc(ceph_wb_pagevec_pool, GFP_NOFS);
5b64640cf65be4 Yan, Zheng 2016-01-07 1049 BUG_ON(!pages);
5b64640cf65be4 Yan, Zheng 2016-01-07 1050 }
5b64640cf65be4 Yan, Zheng 2016-01-07 1051 memcpy(pages, data_pages + i,
5b64640cf65be4 Yan, Zheng 2016-01-07 1052 locked_pages * sizeof(*pages));
5b64640cf65be4 Yan, Zheng 2016-01-07 1053 memset(data_pages + i, 0,
5b64640cf65be4 Yan, Zheng 2016-01-07 1054 locked_pages * sizeof(*pages));
5b64640cf65be4 Yan, Zheng 2016-01-07 1055 } else {
5b64640cf65be4 Yan, Zheng 2016-01-07 1056 BUG_ON(num_ops != req->r_num_ops);
5b64640cf65be4 Yan, Zheng 2016-01-07 1057 index = pages[i - 1]->index + 1;
5b64640cf65be4 Yan, Zheng 2016-01-07 1058 /* request message now owns the pages array */
5b64640cf65be4 Yan, Zheng 2016-01-07 1059 pages = NULL;
5b64640cf65be4 Yan, Zheng 2016-01-07 1060 }
e5975c7c8eb6ae Alex Elder 2013-03-14 1061
fac02ddf910814 Arnd Bergmann 2018-07-13 1062 req->r_mtime = inode->i_mtime;
9d6fcb081a4770 Sage Weil 2011-05-12 1063 rc = ceph_osdc_start_request(&fsc->client->osdc, req, true);
9d6fcb081a4770 Sage Weil 2011-05-12 1064 BUG_ON(rc);
1d3576fd10f0d7 Sage Weil 2009-10-06 1065 req = NULL;
1d3576fd10f0d7 Sage Weil 2009-10-06 1066
5b64640cf65be4 Yan, Zheng 2016-01-07 1067 wbc->nr_to_write -= i;
5b64640cf65be4 Yan, Zheng 2016-01-07 1068 if (pages)
5b64640cf65be4 Yan, Zheng 2016-01-07 1069 goto new_request;
5b64640cf65be4 Yan, Zheng 2016-01-07 1070
2a2d927e35dd8d Yan, Zheng 2017-09-01 1071 /*
2a2d927e35dd8d Yan, Zheng 2017-09-01 1072 * We stop writing back only if we are not doing
2a2d927e35dd8d Yan, Zheng 2017-09-01 1073 * integrity sync. In case of integrity sync we have to
2a2d927e35dd8d Yan, Zheng 2017-09-01 1074 * keep going until we have written all the pages
2a2d927e35dd8d Yan, Zheng 2017-09-01 1075 * we tagged for writeback prior to entering this loop.
2a2d927e35dd8d Yan, Zheng 2017-09-01 1076 */
2a2d927e35dd8d Yan, Zheng 2017-09-01 1077 if (wbc->nr_to_write <= 0 && wbc->sync_mode == WB_SYNC_NONE)
af9cc401ce7452 Yan, Zheng 2018-03-04 1078 done = true;
1d3576fd10f0d7 Sage Weil 2009-10-06 1079
1d3576fd10f0d7 Sage Weil 2009-10-06 1080 release_pvec_pages:
1d3576fd10f0d7 Sage Weil 2009-10-06 1081 dout("pagevec_release on %d pages (%p)\n", (int)pvec.nr,
1d3576fd10f0d7 Sage Weil 2009-10-06 1082 pvec.nr ? pvec.pages[0] : NULL);
1d3576fd10f0d7 Sage Weil 2009-10-06 1083 pagevec_release(&pvec);
1d3576fd10f0d7 Sage Weil 2009-10-06 1084 }
1d3576fd10f0d7 Sage Weil 2009-10-06 1085
1d3576fd10f0d7 Sage Weil 2009-10-06 1086 if (should_loop && !done) {
1d3576fd10f0d7 Sage Weil 2009-10-06 1087 /* more to do; loop back to beginning of file */
1d3576fd10f0d7 Sage Weil 2009-10-06 1088 dout("writepages looping back to beginning of file\n");
2a2d927e35dd8d Yan, Zheng 2017-09-01 1089 end = start_index - 1; /* OK even when start_index == 0 */
f275635ee0b664 Yan, Zheng 2017-09-01 1090
f275635ee0b664 Yan, Zheng 2017-09-01 1091 /* to write dirty pages associated with next snapc,
f275635ee0b664 Yan, Zheng 2017-09-01 1092 * we need to wait until current writes complete */
f275635ee0b664 Yan, Zheng 2017-09-01 1093 if (wbc->sync_mode != WB_SYNC_NONE &&
f275635ee0b664 Yan, Zheng 2017-09-01 1094 start_index == 0 && /* all dirty pages were checked */
f275635ee0b664 Yan, Zheng 2017-09-01 1095 !ceph_wbc.head_snapc) {
f275635ee0b664 Yan, Zheng 2017-09-01 1096 struct page *page;
f275635ee0b664 Yan, Zheng 2017-09-01 1097 unsigned i, nr;
f275635ee0b664 Yan, Zheng 2017-09-01 1098 index = 0;
f275635ee0b664 Yan, Zheng 2017-09-01 1099 while ((index <= end) &&
f275635ee0b664 Yan, Zheng 2017-09-01 1100 (nr = pagevec_lookup_tag(&pvec, mapping, &index,
67fd707f468142 Jan Kara 2017-11-15 1101 PAGECACHE_TAG_WRITEBACK))) {
f275635ee0b664 Yan, Zheng 2017-09-01 1102 for (i = 0; i < nr; i++) {
f275635ee0b664 Yan, Zheng 2017-09-01 1103 page = pvec.pages[i];
bd62d82fbd1b69 David Howells 2021-08-11 1104 if (folio_snap_context(folio) != snapc)
f275635ee0b664 Yan, Zheng 2017-09-01 1105 continue;
f275635ee0b664 Yan, Zheng 2017-09-01 1106 wait_on_page_writeback(page);
f275635ee0b664 Yan, Zheng 2017-09-01 1107 }
f275635ee0b664 Yan, Zheng 2017-09-01 1108 pagevec_release(&pvec);
f275635ee0b664 Yan, Zheng 2017-09-01 1109 cond_resched();
f275635ee0b664 Yan, Zheng 2017-09-01 1110 }
f275635ee0b664 Yan, Zheng 2017-09-01 1111 }
f275635ee0b664 Yan, Zheng 2017-09-01 1112
2a2d927e35dd8d Yan, Zheng 2017-09-01 1113 start_index = 0;
1d3576fd10f0d7 Sage Weil 2009-10-06 1114 index = 0;
1d3576fd10f0d7 Sage Weil 2009-10-06 1115 goto retry;
1d3576fd10f0d7 Sage Weil 2009-10-06 1116 }
1d3576fd10f0d7 Sage Weil 2009-10-06 1117
1d3576fd10f0d7 Sage Weil 2009-10-06 1118 if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
1d3576fd10f0d7 Sage Weil 2009-10-06 1119 mapping->writeback_index = index;
1d3576fd10f0d7 Sage Weil 2009-10-06 1120
1d3576fd10f0d7 Sage Weil 2009-10-06 1121 out:
1d3576fd10f0d7 Sage Weil 2009-10-06 1122 ceph_osdc_put_request(req);
2a2d927e35dd8d Yan, Zheng 2017-09-01 1123 ceph_put_snap_context(last_snapc);
2a2d927e35dd8d Yan, Zheng 2017-09-01 1124 dout("writepages dend - startone, rc = %d\n", rc);
1d3576fd10f0d7 Sage Weil 2009-10-06 1125 return rc;
1d3576fd10f0d7 Sage Weil 2009-10-06 1126 }
1d3576fd10f0d7 Sage Weil 2009-10-06 1127
:::::: The code at line 813 was first introduced by commit
:::::: 1d3576fd10f0d7a104204267b81cf84a07028dad ceph: address space operations
:::::: TO: Sage Weil <sage(a)newdream.net>
:::::: CC: Sage Weil <sage(a)newdream.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[dhowells-fs:netfs-folio 3/3] fs/ceph/addr.c:553:2: warning: #warning ^^^ which page?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio
head: bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e
commit: bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e [3/3] ceph: Use folios
config: arm-randconfig-s031-20210812 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio
git checkout bd62d82fbd1b69357ba3c0d8dffc62fd861f6d3e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/ceph/addr.c: In function 'writepage_nounlock':
>> fs/ceph/addr.c:553:2: warning: #warning ^^^ which page? [-Wcpp]
553 | #warning ^^^ which page?
| ^~~~~~~
fs/ceph/addr.c: In function 'writepages_finish':
>> fs/ceph/addr.c:674:2: warning: #warning ^^^ page or folio? [-Wcpp]
674 | #warning ^^^ page or folio?
| ^~~~~~~
fs/ceph/addr.c: In function 'ceph_writepages_start':
fs/ceph/addr.c:813:4: error: 'page' undeclared (first use in this function)
813 | page = pvec.pages[i];
| ^~~~
fs/ceph/addr.c:813:4: note: each undeclared identifier is reported only once for each function it appears in
In file included from fs/ceph/addr.c:2:
fs/ceph/addr.c:814:46: error: passing argument 1 of 'folio_index' from incompatible pointer type [-Werror=incompatible-pointer-types]
814 | dout("? %p idx %lu\n", folio, folio_index(folio));
| ^~~~~
| |
| struct page *
include/linux/ceph/ceph_debug.h:26:29: note: in definition of macro 'dout'
26 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:457:49: note: expected 'struct folio *' but argument is of type 'struct page *'
457 | static inline pgoff_t folio_index(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:816:16: error: passing argument 1 of 'folio_lock' from incompatible pointer type [-Werror=incompatible-pointer-types]
816 | folio_lock(folio); /* first page */
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:700:45: note: expected 'struct folio *' but argument is of type 'struct page *'
700 | static inline void folio_lock(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
fs/ceph/addr.c:817:28: error: passing argument 1 of 'folio_trylock' from incompatible pointer type [-Werror=incompatible-pointer-types]
817 | else if (!folio_trylock(folio))
| ^~~~~
| |
| struct page *
In file included from fs/ceph/addr.c:7:
include/linux/pagemap.h:687:48: note: expected 'struct folio *' but argument is of type 'struct page *'
687 | static inline bool folio_trylock(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
fs/ceph/addr.c:821:35: error: passing argument 1 of 'folio_test_dirty' from incompatible pointer type [-Werror=incompatible-pointer-types]
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~
| |
| struct page *
include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
33 | ______r = __builtin_expect(!!(x), expect); \
| ^
fs/ceph/addr.c:821:8: note: in expansion of macro 'unlikely'
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~~~~
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:313:62: note: expected 'struct folio *' but argument is of type 'struct page *'
313 | static __always_inline bool folio_test_##lname(struct folio *folio) \
| ~~~~~~~~~~~~~~^~~~~
include/linux/page-flags.h:361:2: note: in expansion of macro 'TESTPAGEFLAG'
361 | TESTPAGEFLAG(uname, lname, policy) \
| ^~~~~~~~~~~~
include/linux/page-flags.h:412:1: note: in expansion of macro 'PAGEFLAG'
412 | PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
| ^~~~~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
from fs/ceph/addr.c:2:
fs/ceph/addr.c:821:35: error: passing argument 1 of 'folio_test_dirty' from incompatible pointer type [-Werror=incompatible-pointer-types]
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~
| |
| struct page *
include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
35 | expect, is_constant); \
| ^~~~~~~~~~~
fs/ceph/addr.c:821:8: note: in expansion of macro 'unlikely'
821 | if (unlikely(!folio_test_dirty(folio)) ||
| ^~~~~~~~
In file included from include/linux/mmzone.h:22,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from include/linux/backing-dev.h:13,
from fs/ceph/addr.c:4:
include/linux/page-flags.h:313:62: note: expected 'struct folio *' but argument is of type 'struct page *'
313 | static __always_inline bool folio_test_##lname(struct folio *folio) \
| ~~~~~~~~~~~~~~^~~~~
include/linux/page-flags.h:361:2: note: in expansion of macro 'TESTPAGEFLAG'
361 | TESTPAGEFLAG(uname, lname, policy) \
| ^~~~~~~~~~~~
include/linux/page-flags.h:412:1: note: in expansion of macro 'PAGEFLAG'
412 | PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
| ^~~~~~~~
In file included from include/linux/string.h:5,
from include/linux/ceph/ceph_debug.h:7,
vim +553 fs/ceph/addr.c
481
482 /*
483 * Write a single folio, but leave the folio locked.
484 *
485 * If we get a write error, mark the mapping for error, but still adjust the
486 * dirty folio accounting (i.e., folio is no longer dirty).
487 */
488 static int writepage_nounlock(struct folio *folio, struct writeback_control *wbc)
489 {
490 struct inode *inode = folio_mapping(folio)->host;
491 struct ceph_inode_info *ci = ceph_inode(inode);
492 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
493 struct ceph_snap_context *snapc, *oldest;
494 loff_t page_pos = folio_file_pos(folio);
495 int err;
496 loff_t len = folio_size(folio);
497 struct ceph_writeback_ctl ceph_wbc;
498 struct ceph_osd_client *osdc = &fsc->client->osdc;
499 struct ceph_osd_request *req;
500 struct page *pages[1];
501
502 dout("writepage %p idx %lu\n", folio, folio_index(folio));
503
504 /* verify this is a writeable snap context */
505 snapc = folio_snap_context(folio);
506 if (!snapc) {
507 dout("writepage %p folio %p not dirty?\n", inode, folio);
508 return 0;
509 }
510 oldest = get_oldest_context(inode, &ceph_wbc, snapc);
511 if (snapc->seq > oldest->seq) {
512 dout("writepage %p folio %p snapc %p not writeable - noop\n",
513 inode, folio, snapc);
514 /* we should only noop if called by kswapd */
515 WARN_ON(!(current->flags & PF_MEMALLOC));
516 ceph_put_snap_context(oldest);
517 folio_redirty_for_writepage(wbc, folio);
518 return 0;
519 }
520 ceph_put_snap_context(oldest);
521
522 /* is this a partial page at end of file? */
523 if (page_pos >= ceph_wbc.i_size) {
524 dout("%p folio eof %llu\n", folio, ceph_wbc.i_size);
525 folio_mapping(folio)->a_ops->invalidatepage(&folio->page, 0, folio_size(folio));
526 return 0;
527 }
528
529 if (ceph_wbc.i_size < page_pos + len)
530 len = ceph_wbc.i_size - page_pos;
531
532 dout("writepage %p folio %p index %lu on %llu~%llu snapc %p seq %lld\n",
533 inode, folio, folio_index(folio), page_pos, len, snapc, snapc->seq);
534
535 if (atomic_long_inc_return(&fsc->writeback_count) >
536 CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
537 set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
538
539 folio_start_writeback(folio);
540 req = ceph_osdc_new_request(osdc, &ci->i_layout, ceph_vino(inode), page_pos, &len, 0, 1,
541 CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE, snapc,
542 ceph_wbc.truncate_seq, ceph_wbc.truncate_size,
543 true);
544 if (IS_ERR(req)) {
545 folio_redirty_for_writepage(wbc, folio);
546 folio_end_writeback(folio);
547 return PTR_ERR(req);
548 }
549
550 /* it may be a short write due to an object boundary */
551 WARN_ON_ONCE(len > folio_size(folio));
552 pages[0] = &folio->page;
> 553 #warning ^^^ which page?
554 osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false);
555 dout("writepage %llu~%llu (%llu bytes)\n", page_pos, len, len);
556
557 req->r_mtime = inode->i_mtime;
558 err = ceph_osdc_start_request(osdc, req, true);
559 if (!err)
560 err = ceph_osdc_wait_request(osdc, req);
561
562 ceph_update_write_metrics(&fsc->mdsc->metric, req->r_start_latency,
563 req->r_end_latency, len, err);
564
565 ceph_osdc_put_request(req);
566 if (err == 0)
567 err = len;
568
569 if (err < 0) {
570 struct writeback_control tmp_wbc;
571 if (!wbc)
572 wbc = &tmp_wbc;
573 if (err == -ERESTARTSYS) {
574 /* killed by SIGKILL */
575 dout("writepage interrupted folio %p\n", folio);
576 folio_redirty_for_writepage(wbc, folio);
577 folio_end_writeback(folio);
578 return err;
579 }
580 if (err == -EBLOCKLISTED)
581 fsc->blocklisted = true;
582 dout("writepage setting folio/mapping error %d %p\n",
583 err, folio);
584 mapping_set_error(&inode->i_data, err);
585 wbc->pages_skipped += folio_nr_pages(folio);
586 } else {
587 dout("writepage cleaned folio %p\n", folio);
588 err = 0; /* vfs expects us to return 0 */
589 }
590 oldest = folio_detach_private(folio);
591 WARN_ON_ONCE(oldest != snapc);
592 folio_end_writeback(folio);
593 ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
594 ceph_put_snap_context(snapc); /* folios's reference */
595
596 if (atomic_long_dec_return(&fsc->writeback_count) <
597 CONGESTION_OFF_THRESH(fsc->mount_options->congestion_kb))
598 clear_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
599
600 return err;
601 }
602
603 static int ceph_writepage(struct page *subpage, struct writeback_control *wbc)
604 {
605 struct folio *folio = page_folio(subpage);
606 int err;
607 struct inode *inode = folio_mapping(folio)->host;
608 BUG_ON(!inode);
609 ihold(inode);
610 err = writepage_nounlock(folio, wbc);
611 if (err == -ERESTARTSYS) {
612 /* direct memory reclaimer was killed by SIGKILL. return 0
613 * to prevent caller from setting mapping/page error */
614 err = 0;
615 }
616 folio_unlock(folio);
617 iput(inode);
618 return err;
619 }
620
621 /*
622 * async writeback completion handler.
623 *
624 * If we get an error, set the mapping error bit, but not the individual
625 * page error bits.
626 */
627 static void writepages_finish(struct ceph_osd_request *req)
628 {
629 struct inode *inode = req->r_inode;
630 struct ceph_inode_info *ci = ceph_inode(inode);
631 struct ceph_osd_data *osd_data;
632 struct folio *folio;
633 int num_pages, total_pages = 0;
634 int i, j;
635 int rc = req->r_result;
636 struct ceph_snap_context *snapc = req->r_snapc;
637 struct address_space *mapping = inode->i_mapping;
638 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
639 unsigned int len = 0;
640 bool remove_page;
641
642 dout("writepages_finish %p rc %d\n", inode, rc);
643 if (rc < 0) {
644 mapping_set_error(mapping, rc);
645 ceph_set_error_write(ci);
646 if (rc == -EBLOCKLISTED)
647 fsc->blocklisted = true;
648 } else {
649 ceph_clear_error_write(ci);
650 }
651
652 /*
653 * We lost the cache cap, need to truncate the page before
654 * it is unlocked, otherwise we'd truncate it later in the
655 * page truncation thread, possibly losing some data that
656 * raced its way in
657 */
658 remove_page = !(ceph_caps_issued(ci) &
659 (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO));
660
661 /* clean all pages */
662 for (i = 0; i < req->r_num_ops; i++) {
663 if (req->r_ops[i].op != CEPH_OSD_OP_WRITE)
664 break;
665
666 osd_data = osd_req_op_extent_osd_data(req, i);
667 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES);
668 len += osd_data->length;
669 num_pages = calc_pages_for((u64)osd_data->alignment,
670 (u64)osd_data->length);
671 total_pages += num_pages;
672 for (j = 0; j < num_pages; j++) {
673 folio = page_folio(osd_data->pages[j]);
> 674 #warning ^^^ page or folio?
675 BUG_ON(!folio);
676 WARN_ON(!folio_test_uptodate(folio));
677
678 if (atomic_long_dec_return(&fsc->writeback_count) <
679 CONGESTION_OFF_THRESH(
680 fsc->mount_options->congestion_kb))
681 clear_bdi_congested(inode_to_bdi(inode),
682 BLK_RW_ASYNC);
683
684 ceph_put_snap_context(folio_detach_private(folio));
685 folio_end_writeback(folio);
686 dout("unlocking %p\n", folio);
687
688 if (remove_page)
689 generic_error_remove_page(inode->i_mapping,
690 &folio->page);
691
692 folio_unlock(folio);
693 }
694 dout("writepages_finish %p wrote %llu bytes cleaned %d pages\n",
695 inode, osd_data->length, rc >= 0 ? num_pages : 0);
696
697 release_pages(osd_data->pages, num_pages);
698 }
699
700 ceph_update_write_metrics(&fsc->mdsc->metric, req->r_start_latency,
701 req->r_end_latency, len, rc);
702
703 ceph_put_wrbuffer_cap_refs(ci, total_pages, snapc);
704
705 osd_data = osd_req_op_extent_osd_data(req, 0);
706 if (osd_data->pages_from_pool)
707 mempool_free(osd_data->pages, ceph_wb_pagevec_pool);
708 else
709 kfree(osd_data->pages);
710 ceph_osdc_put_request(req);
711 }
712
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[xlnx:master 49/59] drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:290: warning: expecting prototype for aie_part_sysfs_create(). Prototype was for aie_part_sysfs_create_entries() instead
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx master
head: af88f405134da108f814cfdf5eac9f2b60f2b800
commit: 094b2cae394e417cb14a83878cf0c817b73bb239 [49/59] misc: xilinx-ai-engine: split grouped sysfs init
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 10.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://github.com/Xilinx/linux-xlnx/commit/094b2cae394e417cb14a83878cf0c...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xlnx master
git checkout 094b2cae394e417cb14a83878cf0c817b73bb239
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/misc/xilinx-ai-engine/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:290: warning: expecting prototype for aie_part_sysfs_create(). Prototype was for aie_part_sysfs_create_entries() instead
drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:307: warning: Function parameter or member 'atile' not described in 'aie_tile_sysfs_create_entries'
>> drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:307: warning: expecting prototype for aie_tile_sysfs_create(). Prototype was for aie_tile_sysfs_create_entries() instead
>> drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:323: warning: expecting prototype for aie_part_sysfs_remove(). Prototype was for aie_part_sysfs_remove_entries() instead
>> drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c:332: warning: expecting prototype for aie_tile_sysfs_remove(). Prototype was for aie_tile_sysfs_remove_entries() instead
vim +290 drivers/misc/xilinx-ai-engine/ai-engine-sysfs.c
12a05be804864f Nishad Saraf 2021-04-12 283
12a05be804864f Nishad Saraf 2021-04-12 284 /**
094b2cae394e41 Daniel Steger 2021-08-02 285 * aie_part_sysfs_create() - creates sysfs group for partition device.
12a05be804864f Nishad Saraf 2021-04-12 286 * @apart: AI engine partition.
12a05be804864f Nishad Saraf 2021-04-12 287 * @return: 0 for success, error code for failure.
12a05be804864f Nishad Saraf 2021-04-12 288 */
094b2cae394e41 Daniel Steger 2021-08-02 289 int aie_part_sysfs_create_entries(struct aie_partition *apart)
12a05be804864f Nishad Saraf 2021-04-12 @290 {
12a05be804864f Nishad Saraf 2021-04-12 291 int ret;
12a05be804864f Nishad Saraf 2021-04-12 292
12a05be804864f Nishad Saraf 2021-04-12 293 ret = aie_part_sysfs_create(apart);
12a05be804864f Nishad Saraf 2021-04-12 294 if (ret < 0) {
094b2cae394e41 Daniel Steger 2021-08-02 295 dev_err(&apart->dev, "Failed to create sysfs partition\n");
094b2cae394e41 Daniel Steger 2021-08-02 296 return ret;
094b2cae394e41 Daniel Steger 2021-08-02 297 }
12a05be804864f Nishad Saraf 2021-04-12 298 return ret;
12a05be804864f Nishad Saraf 2021-04-12 299 }
12a05be804864f Nishad Saraf 2021-04-12 300
094b2cae394e41 Daniel Steger 2021-08-02 301 /**
094b2cae394e41 Daniel Steger 2021-08-02 302 * aie_tile_sysfs_create() - creates sysfs group for tile device.
094b2cae394e41 Daniel Steger 2021-08-02 303 * @apart: AI engine partition.
094b2cae394e41 Daniel Steger 2021-08-02 304 * @return: 0 for success, error code for failure.
094b2cae394e41 Daniel Steger 2021-08-02 305 */
094b2cae394e41 Daniel Steger 2021-08-02 306 int aie_tile_sysfs_create_entries(struct aie_tile *atile)
094b2cae394e41 Daniel Steger 2021-08-02 @307 {
094b2cae394e41 Daniel Steger 2021-08-02 308 int ret;
094b2cae394e41 Daniel Steger 2021-08-02 309
12a05be804864f Nishad Saraf 2021-04-12 310 ret = aie_tile_sysfs_create(atile);
12a05be804864f Nishad Saraf 2021-04-12 311 if (ret < 0) {
094b2cae394e41 Daniel Steger 2021-08-02 312 dev_err(&atile->dev, "Failed to create sysfs tile\n");
12a05be804864f Nishad Saraf 2021-04-12 313 return ret;
12a05be804864f Nishad Saraf 2021-04-12 314 }
12a05be804864f Nishad Saraf 2021-04-12 315 return ret;
12a05be804864f Nishad Saraf 2021-04-12 316 }
094b2cae394e41 Daniel Steger 2021-08-02 317
094b2cae394e41 Daniel Steger 2021-08-02 318 /**
094b2cae394e41 Daniel Steger 2021-08-02 319 * aie_part_sysfs_remove() - removes sysfs group from partition device.
094b2cae394e41 Daniel Steger 2021-08-02 320 * @apart: AI engine partition.
094b2cae394e41 Daniel Steger 2021-08-02 321 */
094b2cae394e41 Daniel Steger 2021-08-02 322 void aie_part_sysfs_remove_entries(struct aie_partition *apart)
094b2cae394e41 Daniel Steger 2021-08-02 @323 {
094b2cae394e41 Daniel Steger 2021-08-02 324 sysfs_remove_group(&apart->dev.kobj, apart->attr_grp);
094b2cae394e41 Daniel Steger 2021-08-02 325 }
094b2cae394e41 Daniel Steger 2021-08-02 326
094b2cae394e41 Daniel Steger 2021-08-02 327 /**
094b2cae394e41 Daniel Steger 2021-08-02 328 * aie_tile_sysfs_remove() - removes sysfs group from tile device.
094b2cae394e41 Daniel Steger 2021-08-02 329 * @atile: AI engine tile.
094b2cae394e41 Daniel Steger 2021-08-02 330 */
094b2cae394e41 Daniel Steger 2021-08-02 331 void aie_tile_sysfs_remove_entries(struct aie_tile *atile)
094b2cae394e41 Daniel Steger 2021-08-02 @332 {
:::::: The code at line 290 was first introduced by commit
:::::: 12a05be804864f46ccaeccdcf806fe68aa489099 misc: xilinx-ai-engine: Create sysfs device attribute framework
:::::: TO: Nishad Saraf <nishad.saraf(a)xilinx.com>
:::::: CC: Michal Simek <michal.simek(a)xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[linux-stable-rc:linux-5.10.y 4013/4144] drivers/ata/pata_cs5520.c:98:19: warning: initialized field overwritten
by kernel test robot
Hi Julian,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
head: 5f894e4a8758db7af6eeb43311c0e9314871b031
commit: 955da2b5cd9855b186f14b71ddb1703d5144193c [4013/4144] lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS
config: csky-buildonly-randconfig-r004-20210812 (attached as .config)
compiler: csky-linux-gcc (GCC) 10.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/stable/linux-stable-rc.gi...
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-5.10.y
git checkout 955da2b5cd9855b186f14b71ddb1703d5144193c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=csky
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/ata/pata_cs5520.c:98:19: warning: initialized field overwritten [-Woverride-init]
98 | .sg_tablesize = LIBATA_DUMB_MAX_PRD,
| ^~~~~~~~~~~~~~~~~~~
drivers/ata/pata_cs5520.c:98:19: note: (near initialization for 'cs5520_sht.sg_tablesize')
--
In function 'sky2_name',
inlined from 'sky2_probe.part.0' at drivers/net/ethernet/marvell/sky2.c:5049:2:
>> drivers/net/ethernet/marvell/sky2.c:4903:3: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
4903 | strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- PROVE_LOCKING && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
vim +98 drivers/ata/pata_cs5520.c
669a5db411d85a Jeff Garzik 2006-08-29 95
669a5db411d85a Jeff Garzik 2006-08-29 96 static struct scsi_host_template cs5520_sht = {
68d1d07b510bb5 Tejun Heo 2008-03-25 97 ATA_BMDMA_SHT(DRV_NAME),
d26fc9551a15fd Alan Cox 2007-07-06 @98 .sg_tablesize = LIBATA_DUMB_MAX_PRD,
669a5db411d85a Jeff Garzik 2006-08-29 99 };
669a5db411d85a Jeff Garzik 2006-08-29 100
:::::: The code at line 98 was first introduced by commit
:::::: d26fc9551a15fdad0d5de8376a78816b8af44f00 libata: Support chips with 64K PRD quirk
:::::: TO: Alan Cox <alan(a)lxorguk.ukuu.org.uk>
:::::: CC: Jeff Garzik <jeff(a)garzik.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[congwang:sch_bpf 2/2] include/linux/rcupdate.h:389:9: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
by kernel test robot
tree: https://github.com/congwang/linux.git sch_bpf
head: aa61f170d88b706060a1977b7b7bef9d08e33ff1
commit: aa61f170d88b706060a1977b7b7bef9d08e33ff1 [2/2] sch_bpf: draft
config: arm-randconfig-r015-20210812 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.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://github.com/congwang/linux/commit/aa61f170d88b706060a1977b7b7bef9d...
git remote add congwang https://github.com/congwang/linux.git
git fetch --no-tags congwang sch_bpf
git checkout aa61f170d88b706060a1977b7b7bef9d08e33ff1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/rbtree.h:22,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from net/sched/sch_bpf.c:7:
net/sched/sch_bpf.c: In function 'sch_bpf_enqueue':
>> include/linux/rcupdate.h:389:9: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
389 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:174:13: note: in expansion of macro 'rcu_dereference'
174 | enqueue = rcu_dereference(q->enqueue_prog);
| ^~~~~~~~~~~~~~~
include/linux/rcupdate.h:389:35: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
389 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:174:13: note: in expansion of macro 'rcu_dereference'
174 | enqueue = rcu_dereference(q->enqueue_prog);
| ^~~~~~~~~~~~~~~
include/linux/rcupdate.h:392:11: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
392 | ((typeof(*p) __force __kernel *)(________p1)); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:174:13: note: in expansion of macro 'rcu_dereference'
174 | enqueue = rcu_dereference(q->enqueue_prog);
| ^~~~~~~~~~~~~~~
net/sched/sch_bpf.c: In function 'sch_bpf_dequeue':
>> include/linux/rcupdate.h:389:9: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
389 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:219:12: note: in expansion of macro 'rcu_dereference'
219 | dequeue = rcu_dereference(q->dequeue_prog);
| ^~~~~~~~~~~~~~~
include/linux/rcupdate.h:389:35: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
389 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:219:12: note: in expansion of macro 'rcu_dereference'
219 | dequeue = rcu_dereference(q->dequeue_prog);
| ^~~~~~~~~~~~~~~
include/linux/rcupdate.h:392:11: error: invalid type argument of unary '*' (have 'struct sch_bpf_prog')
392 | ((typeof(*p) __force __kernel *)(________p1)); \
| ^
include/linux/rcupdate.h:528:2: note: in expansion of macro '__rcu_dereference_check'
528 | __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:596:28: note: in expansion of macro 'rcu_dereference_check'
596 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
| ^~~~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c:219:12: note: in expansion of macro 'rcu_dereference'
219 | dequeue = rcu_dereference(q->dequeue_prog);
| ^~~~~~~~~~~~~~~
>> net/sched/sch_bpf.c:220:28: error: 'skb' undeclared (first use in this function)
220 | bpf_compute_data_pointers(skb);
| ^~~
net/sched/sch_bpf.c:220:28: note: each undeclared identifier is reported only once for each function it appears in
>> net/sched/sch_bpf.c:231:11: error: assignment to 'struct sk_buff *' from incompatible pointer type 'struct pq_node *' [-Werror=incompatible-pointer-types]
231 | ctx.skb = pq_pop(&cl->pq);
| ^
>> net/sched/sch_bpf.c:237:13: error: 'SCH_BPF_RET_OK' undeclared (first use in this function)
237 | if (res == SCH_BPF_RET_OK) {
| ^~~~~~~~~~~~~~
>> net/sched/sch_bpf.c:239:20: error: 'SCH_BPF_RET_REQUEUE' undeclared (first use in this function)
239 | } else if (res == SCH_BPF_RET_REQUEUE) {
| ^~~~~~~~~~~~~~~~~~~
net/sched/sch_bpf.c: In function 'sch_bpf_search':
>> net/sched/sch_bpf.c:284:37: warning: passing argument 1 of 'sch_bpf_find' makes pointer from integer without a cast [-Wint-conversion]
284 | return (unsigned long)sch_bpf_find(handle, sch);
| ^~~~~~
| |
| u32 {aka unsigned int}
net/sched/sch_bpf.c:115:57: note: expected 'struct Qdisc *' but argument is of type 'u32' {aka 'unsigned int'}
115 | static struct sch_bpf_class *sch_bpf_find(struct Qdisc *sch, u32 classid)
| ~~~~~~~~~~~~~~^~~
>> net/sched/sch_bpf.c:284:45: warning: passing argument 2 of 'sch_bpf_find' makes integer from pointer without a cast [-Wint-conversion]
284 | return (unsigned long)sch_bpf_find(handle, sch);
| ^~~
| |
| struct Qdisc *
net/sched/sch_bpf.c:115:66: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'struct Qdisc *'
115 | static struct sch_bpf_class *sch_bpf_find(struct Qdisc *sch, u32 classid)
| ~~~~^~~~~~~
net/sched/sch_bpf.c: At top level:
>> net/sched/sch_bpf.c:298:3: error: 'TCA_SCH_BPF_ENQUEUE_PROG_FD' undeclared here (not in a function); did you mean 'TCA_SCH_BPF_ENQUEUE_PROG_ID'?
298 | [TCA_SCH_BPF_ENQUEUE_PROG_FD] = { .type = NLA_U32 },
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| TCA_SCH_BPF_ENQUEUE_PROG_ID
>> net/sched/sch_bpf.c:298:3: error: array index in initializer not of integer type
net/sched/sch_bpf.c:298:3: note: (near initialization for 'sch_bpf_policy')
>> net/sched/sch_bpf.c:301:3: error: 'TCA_SCH_BPF_DEQUEUE_PROG_FD' undeclared here (not in a function); did you mean 'TCA_SCH_BPF_DEQUEUE_PROG_ID'?
301 | [TCA_SCH_BPF_DEQUEUE_PROG_FD] = { .type = NLA_U32 },
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| TCA_SCH_BPF_DEQUEUE_PROG_ID
net/sched/sch_bpf.c:301:3: error: array index in initializer not of integer type
net/sched/sch_bpf.c:301:3: note: (near initialization for 'sch_bpf_policy')
net/sched/sch_bpf.c: In function 'bpf_init_prog':
>> net/sched/sch_bpf.c:314:33: error: 'BPF_PROG_TYPE_SCHED_SCH' undeclared (first use in this function); did you mean 'BPF_PROG_TYPE_SCHED_ACT'?
314 | fp = bpf_prog_get_type(bpf_fd, BPF_PROG_TYPE_SCHED_SCH);
| ^~~~~~~~~~~~~~~~~~~~~~~
| BPF_PROG_TYPE_SCHED_ACT
net/sched/sch_bpf.c: At top level:
net/sched/sch_bpf.c:331:8: error: return type defaults to 'int' [-Werror=return-type]
331 | static bpf_cleanup_prog(struct sch_bpf_prog *prog)
| ^~~~~~~~~~~~~~~~
net/sched/sch_bpf.c: In function 'sch_bpf_change':
>> net/sched/sch_bpf.c:354:11: error: incompatible type for argument 2 of 'bpf_init_prog'
354 | opt[TCA_SCH_BPF_ENQUEUE_PROG_NAME], &q->enqueue_prog);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct nlattr
net/sched/sch_bpf.c:306:60: note: expected 'struct nlattr *' but argument is of type 'struct nlattr'
306 | static int bpf_init_prog(struct nlattr *fd, struct nlattr *name, struct sch_bpf_prog *prog)
| ~~~~~~~~~~~~~~~^~~~
net/sched/sch_bpf.c:358:11: error: incompatible type for argument 2 of 'bpf_init_prog'
358 | opt[TCA_SCH_BPF_DEQUEUE_PROG_NAME], &q->dequeue_prog);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct nlattr
net/sched/sch_bpf.c:306:60: note: expected 'struct nlattr *' but argument is of type 'struct nlattr'
306 | static int bpf_init_prog(struct nlattr *fd, struct nlattr *name, struct sch_bpf_prog *prog)
| ~~~~~~~~~~~~~~~^~~~
net/sched/sch_bpf.c:343:6: warning: unused variable 'gen_flags' [-Wunused-variable]
343 | u32 gen_flags = 0;
| ^~~~~~~~~
net/sched/sch_bpf.c: In function 'sch_bpf_init':
>> net/sched/sch_bpf.c:388:3: error: 'err' undeclared (first use in this function)
388 | err = sch_bpf_change(sch, opt, extack);
| ^~~
net/sched/sch_bpf.c: In function 'sch_bpf_change_class':
net/sched/sch_bpf.c:428:3: error: 'err' undeclared (first use in this function)
428 | err = -ENOBUFS;
| ^~~
>> net/sched/sch_bpf.c:431:4: error: label 'failure' used but not defined
431 | goto failure;
| ^~~~
net/sched/sch_bpf.c:424:60: warning: unused variable 'parent' [-Wunused-variable]
424 | struct sch_bpf_class *cl = (struct sch_bpf_class *)*arg, *parent;
| ^~~~~~
net/sched/sch_bpf.c: In function 'sch_bpf_delete':
net/sched/sch_bpf.c:450:1: error: no return statement in function returning non-void [-Werror=return-type]
450 | }
| ^
net/sched/sch_bpf.c: At top level:
>> net/sched/sch_bpf.c:481:13: error: initialization of 'int (*)(struct Qdisc *, long unsigned int, struct netlink_ext_ack *)' from incompatible pointer type 'int (*)(struct Qdisc *, long unsigned int)' [-Werror=incompatible-pointer-types]
481 | .delete = sch_bpf_delete,
| ^~~~~~~~~~~~~~
net/sched/sch_bpf.c:481:13: note: (near initialization for 'sch_bpf_class_ops.delete')
>> net/sched/sch_bpf.c:485:11: error: 'sch_bpf_dump_class' undeclared here (not in a function); did you mean 'sch_bpf_dump_prog'?
485 | .dump = sch_bpf_dump_class,
| ^~~~~~~~~~~~~~~~~~
| sch_bpf_dump_prog
>> net/sched/sch_bpf.c:486:16: error: 'sch_bpf_dump_class_stats' undeclared here (not in a function)
486 | .dump_stats = sch_bpf_dump_class_stats,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> net/sched/sch_bpf.c:498:12: error: 'sch_bpf_reset' undeclared here (not in a function); did you mean 'sch_bpf_delete'?
498 | .reset = sch_bpf_reset,
| ^~~~~~~~~~~~~
| sch_bpf_delete
>> net/sched/sch_bpf.c:502:16: error: 'sch_bpf_dump_stats' undeclared here (not in a function); did you mean 'sch_bpf_dump_prog'?
502 | .dump_stats = sch_bpf_dump_stats,
| ^~~~~~~~~~~~~~~~~~
| sch_bpf_dump_prog
net/sched/sch_bpf.c:506:19: error: conflicting types for 'sch_bpf_init'
506 | static int __init sch_bpf_init(void)
| ^~~~~~~~~~~~
net/sched/sch_bpf.c:382:12: note: previous definition of 'sch_bpf_init' was here
382 | static int sch_bpf_init(struct Qdisc *sch, struct nlattr *opt,
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +389 include/linux/rcupdate.h
76c8eaafe4f061 Paul E. McKenney 2021-04-21 379
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 380 #define __rcu_access_pointer(p, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 381 ({ \
7d0ae8086b8283 Paul E. McKenney 2015-03-03 382 typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 383) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 384 ((typeof(*p) __force __kernel *)(_________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 385 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 386 #define __rcu_dereference_check(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 387 ({ \
ac59853c06993a Pranith Kumar 2014-11-13 388 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 @389 typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 390 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 391) rcu_check_sparse(p, space); \
ac59853c06993a Pranith Kumar 2014-11-13 392 ((typeof(*p) __force __kernel *)(________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 393 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 394 #define __rcu_dereference_protected(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 395 ({ \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 396 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 397) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 398 ((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 399 })
995f1405610bd8 Paul E. McKenney 2016-07-01 400 #define rcu_dereference_raw(p) \
995f1405610bd8 Paul E. McKenney 2016-07-01 401 ({ \
995f1405610bd8 Paul E. McKenney 2016-07-01 402 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 403 typeof(p) ________p1 = READ_ONCE(p); \
995f1405610bd8 Paul E. McKenney 2016-07-01 404 ((typeof(*p) __force __kernel *)(________p1)); \
995f1405610bd8 Paul E. McKenney 2016-07-01 405 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 406
:::::: The code at line 389 was first introduced by commit
:::::: 506458efaf153c1ea480591c5602a5a3ba5a3b76 locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
:::::: TO: Will Deacon <will.deacon(a)arm.com>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
dissertation writing service
by Oliver Jake
We Provide dissertation writing service In The UK. Our team is highly inclined to help those students who face difficulties in completing Essay and Assignments due to any reason. We are serving students for many years with clear goals, high values, work excellence, and a supreme reputation. Encourage Students To Overcome Academic Work Processes By Providing Affordable essay Writing Services in the UK.
https://essaysnassignments.co.uk/dissertation-writing-services/
1 year, 1 month