cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [kbuild] [gfs2:for-next 9/11] fs/gfs2/file.c:796:24: sparse: unsigned int *
Date: Thu, 17 Mar 2022 10:08:44 +0100	[thread overview]
Message-ID: <CAHc6FU6O-8sjt5vpLDUk29Ogm5Y3rDxqZJfQNDC-pOEOH9oHeA@mail.gmail.com> (raw)
In-Reply-To: <202203170954.vFlMcTje-lkp@intel.com>

On Thu, Mar 17, 2022 at 9:25 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git  for-next
> head:   a20050c14edf19add5a9588cb196bb00aa410650
> commit: 165d142ffacdef3e620819a1031df3d896aa29ab [9/11] gfs2: Fix should_fault_in_pages() logic
> config: sh-randconfig-s032-20220313 (https://download.01.org/0day-ci/archive/20220317/202203170954.vFlMcTje-lkp at intel.com/config )
> compiler: sh4-linux-gcc (GCC) 11.2.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.4-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/?id=165d142ffacdef3e620819a1031df3d896aa29ab
>         git remote add gfs2 https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
>         git fetch --no-tags gfs2 for-next
>         git checkout 165d142ffacdef3e620819a1031df3d896aa29ab
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash fs/gfs2/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> sparse warnings: (new ones prefixed by >>)
>    fs/gfs2/file.c:796:24: sparse: sparse: incompatible types in comparison expression (different signedness):
> >> fs/gfs2/file.c:796:24: sparse:    unsigned int *
>    fs/gfs2/file.c:796:24: sparse:    int *
> >> fs/gfs2/file.c:796:24: sparse: sparse: cannot size expression
>
> vim +796 fs/gfs2/file.c
>
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  773  static inline bool should_fault_in_pages(ssize_t ret, struct iov_iter *i,
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  774                                    size_t *prev_count,
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  775                                    size_t *window_size)
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  776  {
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  777   size_t count = iov_iter_count(i);
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  778   size_t size, offs;
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  779
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  780   if (likely(!count))
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  781           return false;
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  782   if (ret <= 0 && ret != -EFAULT)
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  783           return false;
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  784   if (!iter_is_iovec(i))
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  785           return false;
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  786
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  787   size = PAGE_SIZE;
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  788   offs = offset_in_page(i->iov[0].iov_base + i->iov_offset);
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  789   if (*prev_count != count || !*window_size) {
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  790           int nr_dirtied;
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  791
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  792           size = ALIGN(offs + count, PAGE_SIZE);
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  793           size = min_t(size_t, size, SZ_1M);
> 00bfe02f479688 fs/gfs2/file.c     Andreas Gruenbacher 2021-10-18  794           nr_dirtied = max(current->nr_dirtied_pause -
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07  795                            current->nr_dirtied, 8);
> 165d142ffacdef fs/gfs2/file.c     Andreas Gruenbacher 2022-03-07 @796           size = min(size, nr_dirtied << PAGE_SHIFT);
>
> size is size_t so nr_dirtied needs to be size_t as well.  I'm surprised
> this compiles.  The min()/max() macros are supposed to trigger a compile
> error for type mismatches.

Already fixed, thanks.

Andreas


      reply	other threads:[~2022-03-17  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  8:24 [Cluster-devel] [kbuild] [gfs2:for-next 9/11] fs/gfs2/file.c:796:24: sparse: unsigned int * Dan Carpenter
2022-03-17  9:08 ` Andreas Gruenbacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHc6FU6O-8sjt5vpLDUk29Ogm5Y3rDxqZJfQNDC-pOEOH9oHeA@mail.gmail.com \
    --to=agruenba@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).