From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8127396502531421029==" MIME-Version: 1.0 From: Chao Yu To: kbuild-all@lists.01.org Subject: Re: [RFC v3] f2fs: extent cache: support unaligned extent Date: Wed, 04 Aug 2021 15:27:51 +0800 Message-ID: <2f1d6327-25d1-e63b-c325-f7481147f3fb@kernel.org> In-Reply-To: <202108041427.S6T0XEHx-lkp@intel.com> List-Id: --===============8127396502531421029== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Jaegeuk, How about this? --- fs/f2fs/f2fs.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a93c49c9b53f..20141e59c55a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -832,18 +832,27 @@ static inline bool __is_discard_front_mergeable(struc= t discard_info *cur, return __is_discard_mergeable(cur, front, max_len); } -static inline bool __is_extent_mergeable(struct extent_info *back, - struct extent_info *front, bool unaligned) +#ifdef CONFIG_F2FS_FS_COMPRESSION +static inline bool __is_unaligned_extent_mergeable(struct extent_info *bac= k, + struct extent_info *front) { - if (unaligned) { - struct extent_info_unaligned *be =3D + struct extent_info_unaligned *be =3D (struct extent_info_unaligned *)back; - struct extent_info_unaligned *fe =3D + struct extent_info_unaligned *fe =3D (struct extent_info_unaligned *)front; - if (be->ei.len !=3D be->plen || fe->ei.len !=3D fe->plen) - return false; - } + return be->ei.len =3D=3D be->plen && fe->ei.len =3D=3D fe->plen; +} +#else +static inline bool __is_unaligned_extent_mergeable(struct extent_info *bac= k, + struct extent_info *front) { return true; } +#endif + +static inline bool __is_extent_mergeable(struct extent_info *back, + struct extent_info *front, bool unaligned) +{ + if (unaligned && !__is_unaligned_extent_mergeable(back, front)) + return false; return (back->fofs + back->len =3D=3D front->fofs && back->blk + back->len =3D=3D front->blk); -- = 2.22.1 On 2021/8/4 14:52, kernel test robot wrote: > Hi Chao, > = > [FYI, it's a private test report for your RFC patch.] > [auto build test ERROR on f2fs/dev-test] > [also build test ERROR on v5.14-rc4 next-20210803] > [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/Chao-Yu/f2fs-extent-cach= e-support-unaligned-extent/20210804-102614 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git = dev-test > config: i386-randconfig-a015-20210804 (attached as .config) > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > reproduce (this is a W=3D1 build): > # https://github.com/0day-ci/linux/commit/5c974bb7b3024da2ab740e= d59459e96ef4b52d5c > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Chao-Yu/f2fs-extent-cache-suppo= rt-unaligned-extent/20210804-102614 > git checkout 5c974bb7b3024da2ab740ed59459e96ef4b52d5c > # save the attached .config to linux build tree > mkdir build_dir > make W=3D1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash fs/ > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All errors (new ones prefixed by >>): > = > In file included from fs/f2fs/dir.c:13: > fs/f2fs/f2fs.h: In function '__is_extent_mergeable': >>> fs/f2fs/f2fs.h:842:9: error: dereferencing pointer to incomplete type '= struct extent_info_unaligned' > 842 | if (be->ei.len !=3D be->plen || fe->ei.len !=3D fe->plen) > | ^~ > -- > In file included from fs/f2fs/extent_cache.c:14: > fs/f2fs/f2fs.h: In function '__is_extent_mergeable': >>> fs/f2fs/f2fs.h:842:9: error: dereferencing pointer to incomplete type '= struct extent_info_unaligned' > 842 | if (be->ei.len !=3D be->plen || fe->ei.len !=3D fe->plen) > | ^~ > fs/f2fs/extent_cache.c: In function '__attach_extent_node': > fs/f2fs/extent_cache.c:251:5: error: 'struct extent_node' has no memb= er named 'plen' > 251 | en->plen =3D ((struct extent_info_unaligned *)ei)->plen; > | ^~ >>> fs/f2fs/extent_cache.c:251:50: error: dereferencing pointer to incomple= te type 'struct extent_info_unaligned' > 251 | en->plen =3D ((struct extent_info_unaligned *)ei)->plen; > | ^~ > = > = > vim +842 fs/f2fs/f2fs.h > = > 832 = > 833 static inline bool __is_extent_mergeable(struct extent_info *back, > 834 struct extent_info *front, bool unaligned) > 835 { > 836 if (unaligned) { > 837 struct extent_info_unaligned *be =3D > 838 (struct extent_info_unaligned *)back; > 839 struct extent_info_unaligned *fe =3D > 840 (struct extent_info_unaligned *)front; > 841 = > > 842 if (be->ei.len !=3D be->plen || fe->ei.len !=3D fe->plen) > 843 return false; > 844 } > 845 = > 846 return (back->fofs + back->len =3D=3D front->fofs && > 847 back->blk + back->len =3D=3D front->blk); > 848 } > 849 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org >=20 --===============8127396502531421029==--