From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Vivek Goyal <vgoyal@redhat.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Miklos Szeredi <mszeredi@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Liu Bo <bo.liu@linux.alibaba.com>,
Peng Tao <tao.peng@linux.alibaba.com>
Subject: [kbuild] fs/fuse/dax.c:113 fuse_setup_one_mapping() warn: should 'start_idx << 21' be a 64 bit type?
Date: Mon, 3 May 2021 16:27:03 +0300 [thread overview]
Message-ID: <202105032112.SJqOaXpO-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ccce092fc64d19504fa54de4fd659e279cc92e7
commit: c2d0ad00d948de73c78f05d2b3e5bdfa605035cc virtiofs: implement dax read/write operations
config: i386-randconfig-m031-20210503 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
fs/fuse/dax.c:113 fuse_setup_one_mapping() warn: should 'start_idx << 21' be a 64 bit type?
Old smatch warnings:
fs/fuse/dax.c:197 dmap_removemapping_list() error: uninitialized symbol 'ret'.
vim +113 fs/fuse/dax.c
c2d0ad00d948de Vivek Goyal 2020-08-19 105 static int fuse_setup_one_mapping(struct inode *inode, unsigned long start_idx,
c2d0ad00d948de Vivek Goyal 2020-08-19 106 struct fuse_dax_mapping *dmap, bool writable,
c2d0ad00d948de Vivek Goyal 2020-08-19 107 bool upgrade)
c2d0ad00d948de Vivek Goyal 2020-08-19 108 {
c2d0ad00d948de Vivek Goyal 2020-08-19 109 struct fuse_conn *fc = get_fuse_conn(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19 110 struct fuse_conn_dax *fcd = fc->dax;
c2d0ad00d948de Vivek Goyal 2020-08-19 111 struct fuse_inode *fi = get_fuse_inode(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19 112 struct fuse_setupmapping_in inarg;
c2d0ad00d948de Vivek Goyal 2020-08-19 @113 loff_t offset = start_idx << FUSE_DAX_SHIFT;
This is only an issue on 32 bit systems but "offset" is a 64bit and
"start_idx" is ulong.
c2d0ad00d948de Vivek Goyal 2020-08-19 114 FUSE_ARGS(args);
c2d0ad00d948de Vivek Goyal 2020-08-19 115 ssize_t err;
c2d0ad00d948de Vivek Goyal 2020-08-19 116
c2d0ad00d948de Vivek Goyal 2020-08-19 117 WARN_ON(fcd->nr_free_ranges < 0);
c2d0ad00d948de Vivek Goyal 2020-08-19 118
c2d0ad00d948de Vivek Goyal 2020-08-19 119 /* Ask fuse daemon to setup mapping */
c2d0ad00d948de Vivek Goyal 2020-08-19 120 memset(&inarg, 0, sizeof(inarg));
c2d0ad00d948de Vivek Goyal 2020-08-19 121 inarg.foffset = offset;
c2d0ad00d948de Vivek Goyal 2020-08-19 122 inarg.fh = -1;
c2d0ad00d948de Vivek Goyal 2020-08-19 123 inarg.moffset = dmap->window_offset;
c2d0ad00d948de Vivek Goyal 2020-08-19 124 inarg.len = FUSE_DAX_SZ;
c2d0ad00d948de Vivek Goyal 2020-08-19 125 inarg.flags |= FUSE_SETUPMAPPING_FLAG_READ;
c2d0ad00d948de Vivek Goyal 2020-08-19 126 if (writable)
c2d0ad00d948de Vivek Goyal 2020-08-19 127 inarg.flags |= FUSE_SETUPMAPPING_FLAG_WRITE;
c2d0ad00d948de Vivek Goyal 2020-08-19 128 args.opcode = FUSE_SETUPMAPPING;
c2d0ad00d948de Vivek Goyal 2020-08-19 129 args.nodeid = fi->nodeid;
c2d0ad00d948de Vivek Goyal 2020-08-19 130 args.in_numargs = 1;
c2d0ad00d948de Vivek Goyal 2020-08-19 131 args.in_args[0].size = sizeof(inarg);
c2d0ad00d948de Vivek Goyal 2020-08-19 132 args.in_args[0].value = &inarg;
c2d0ad00d948de Vivek Goyal 2020-08-19 133 err = fuse_simple_request(fc, &args);
c2d0ad00d948de Vivek Goyal 2020-08-19 134 if (err < 0)
c2d0ad00d948de Vivek Goyal 2020-08-19 135 return err;
c2d0ad00d948de Vivek Goyal 2020-08-19 136 dmap->writable = writable;
c2d0ad00d948de Vivek Goyal 2020-08-19 137 if (!upgrade) {
c2d0ad00d948de Vivek Goyal 2020-08-19 138 dmap->itn.start = dmap->itn.last = start_idx;
c2d0ad00d948de Vivek Goyal 2020-08-19 139 /* Protected by fi->dax->sem */
c2d0ad00d948de Vivek Goyal 2020-08-19 140 interval_tree_insert(&dmap->itn, &fi->dax->tree);
c2d0ad00d948de Vivek Goyal 2020-08-19 141 fi->dax->nr++;
c2d0ad00d948de Vivek Goyal 2020-08-19 142 }
c2d0ad00d948de Vivek Goyal 2020-08-19 143 return 0;
c2d0ad00d948de Vivek Goyal 2020-08-19 144 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
next reply other threads:[~2021-05-03 13:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 13:27 Dan Carpenter [this message]
2021-05-11 14:21 ` [kbuild] fs/fuse/dax.c:113 fuse_setup_one_mapping() warn: should 'start_idx << 21' be a 64 bit type? Miklos Szeredi
2021-05-11 14:51 ` Vivek Goyal
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=202105032112.SJqOaXpO-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=bo.liu@linux.alibaba.com \
--cc=dgilbert@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mszeredi@redhat.com \
--cc=stefanha@redhat.com \
--cc=tao.peng@linux.alibaba.com \
--cc=vgoyal@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