* [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers
@ 2025-07-10 7:17 kernel test robot
2025-07-10 13:57 ` Matthew Wilcox
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2025-07-10 7:17 UTC (permalink / raw)
To: Matthew Wilcox (Oracle)
Cc: llvm, oe-kbuild-all, linux-f2fs-devel, Jaegeuk Kim
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
head: bc8610a18daa4a611d189374031fe1fa3c603423
commit: 9f506c758707749076b4ec2402007670c6f35558 [65/93] f2fs: Use a folio in f2fs_is_cp_guaranteed()
config: s390-randconfig-002-20250710 (https://download.01.org/0day-ci/archive/20250710/202507101412.50ND2WEX-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250710/202507101412.50ND2WEX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507101412.50ND2WEX-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
58 | return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
| ^~~~~
include/linux/fscrypt.h:527:67: note: passing argument to parameter 'bounce_folio' here
527 | static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
| ^
1 error generated.
vim +58 fs/f2fs/data.c
49
50 bool f2fs_is_cp_guaranteed(const struct page *page)
51 {
52 const struct folio *folio = page_folio(page);
53 struct address_space *mapping = folio->mapping;
54 struct inode *inode;
55 struct f2fs_sb_info *sbi;
56
57 if (fscrypt_is_bounce_folio(folio))
> 58 return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
59
60 inode = mapping->host;
61 sbi = F2FS_I_SB(inode);
62
63 if (inode->i_ino == F2FS_META_INO(sbi) ||
64 inode->i_ino == F2FS_NODE_INO(sbi) ||
65 S_ISDIR(inode->i_mode))
66 return true;
67
68 if ((S_ISREG(inode->i_mode) && IS_NOQUOTA(inode)) ||
69 folio_test_f2fs_gcing(folio))
70 return true;
71 return false;
72 }
73
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers
2025-07-10 7:17 [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers kernel test robot
@ 2025-07-10 13:57 ` Matthew Wilcox
2025-07-10 14:26 ` Jaegeuk Kim
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2025-07-10 13:57 UTC (permalink / raw)
To: kernel test robot; +Cc: llvm, oe-kbuild-all, linux-f2fs-devel, Jaegeuk Kim
On Thu, Jul 10, 2025 at 03:17:28PM +0800, kernel test robot wrote:
> >> fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> 58 | return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
> | ^~~~~
> include/linux/fscrypt.h:527:67: note: passing argument to parameter 'bounce_folio' here
> 527 | static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
Ah; I changed only one of the definitions of fscrypt_pagecache_folio.
Jaegeuk, can you fold in this fix?
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index b334c0538864..8d9127a0fdb3 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -524,7 +524,8 @@ static inline bool fscrypt_is_bounce_folio(const struct folio *folio)
return false;
}
-static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
+static inline
+struct folio *fscrypt_pagecache_folio(const struct folio *bounce_folio)
{
WARN_ON_ONCE(1);
return ERR_PTR(-EINVAL);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers
2025-07-10 13:57 ` Matthew Wilcox
@ 2025-07-10 14:26 ` Jaegeuk Kim
2025-07-10 15:16 ` Matthew Wilcox
0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2025-07-10 14:26 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: kernel test robot, llvm, oe-kbuild-all, linux-f2fs-devel
On 07/10, Matthew Wilcox wrote:
> On Thu, Jul 10, 2025 at 03:17:28PM +0800, kernel test robot wrote:
> > >> fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > 58 | return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
> > | ^~~~~
> > include/linux/fscrypt.h:527:67: note: passing argument to parameter 'bounce_folio' here
> > 527 | static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
>
> Ah; I changed only one of the definitions of fscrypt_pagecache_folio.
>
> Jaegeuk, can you fold in this fix?
Will this break ext4?
In ext4,
struct folio *folio = fi.folio;
...
if (fscrypt_is_bounce_folio(folio)) {
io_folio = folio;
folio = fscrypt_pagecache_folio(folio);
}
>
> diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
> index b334c0538864..8d9127a0fdb3 100644
> --- a/include/linux/fscrypt.h
> +++ b/include/linux/fscrypt.h
> @@ -524,7 +524,8 @@ static inline bool fscrypt_is_bounce_folio(const struct folio *folio)
> return false;
> }
>
> -static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
> +static inline
> +struct folio *fscrypt_pagecache_folio(const struct folio *bounce_folio)
> {
> WARN_ON_ONCE(1);
> return ERR_PTR(-EINVAL);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers
2025-07-10 14:26 ` Jaegeuk Kim
@ 2025-07-10 15:16 ` Matthew Wilcox
2025-07-10 16:49 ` Jaegeuk Kim
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2025-07-10 15:16 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: kernel test robot, llvm, oe-kbuild-all, linux-f2fs-devel
On Thu, Jul 10, 2025 at 02:26:38PM +0000, Jaegeuk Kim wrote:
> On 07/10, Matthew Wilcox wrote:
> > On Thu, Jul 10, 2025 at 03:17:28PM +0800, kernel test robot wrote:
> > > >> fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > > 58 | return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
> > > | ^~~~~
> > > include/linux/fscrypt.h:527:67: note: passing argument to parameter 'bounce_folio' here
> > > 527 | static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
> >
> > Ah; I changed only one of the definitions of fscrypt_pagecache_folio.
> >
> > Jaegeuk, can you fold in this fix?
>
> Will this break ext4?
>
> In ext4,
> struct folio *folio = fi.folio;
> ...
>
> if (fscrypt_is_bounce_folio(folio)) {
> io_folio = folio;
> folio = fscrypt_pagecache_folio(folio);
> }
No, you can pass a mutable folio to a function which takes a const
folio. Just not the other way around.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers
2025-07-10 15:16 ` Matthew Wilcox
@ 2025-07-10 16:49 ` Jaegeuk Kim
0 siblings, 0 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2025-07-10 16:49 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: kernel test robot, llvm, oe-kbuild-all, linux-f2fs-devel
On 07/10, Matthew Wilcox wrote:
> On Thu, Jul 10, 2025 at 02:26:38PM +0000, Jaegeuk Kim wrote:
> > On 07/10, Matthew Wilcox wrote:
> > > On Thu, Jul 10, 2025 at 03:17:28PM +0800, kernel test robot wrote:
> > > > >> fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > > > 58 | return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
> > > > | ^~~~~
> > > > include/linux/fscrypt.h:527:67: note: passing argument to parameter 'bounce_folio' here
> > > > 527 | static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
> > >
> > > Ah; I changed only one of the definitions of fscrypt_pagecache_folio.
> > >
> > > Jaegeuk, can you fold in this fix?
> >
> > Will this break ext4?
> >
> > In ext4,
> > struct folio *folio = fi.folio;
> > ...
> >
> > if (fscrypt_is_bounce_folio(folio)) {
> > io_folio = folio;
> > folio = fscrypt_pagecache_folio(folio);
> > }
>
> No, you can pass a mutable folio to a function which takes a const
> folio. Just not the other way around.
Ah, I found it. Applied the above missing change.
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=70e71e8a0099d27857fdb9178187e72513d72141
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-10 16:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 7:17 [jaegeuk-f2fs:dev-test 65/93] fs/f2fs/data.c:58:56: error: passing 'const struct folio *' to parameter of type 'struct folio *' discards qualifiers kernel test robot
2025-07-10 13:57 ` Matthew Wilcox
2025-07-10 14:26 ` Jaegeuk Kim
2025-07-10 15:16 ` Matthew Wilcox
2025-07-10 16:49 ` Jaegeuk Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).