On Mon, Apr 24, 2017 at 4:32 PM, kbuild test robot <lkp@xxxxxxxxx> wrote: > Hi Amir, > > [auto build test WARNING on miklos-vfs/overlayfs-next] > [also build test WARNING on v4.11-rc8 next-20170424] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Amir-Goldstein/overlayfs-constant-inode-numbers/20170424-175555 > base: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next > > > coccinelle warnings: (new ones prefixed by >>) > >>> fs/overlayfs/copy_up.c:309:7-14: ERROR: PTR_ERR applied after initialization to constant on line 299 Why is this wrong? The pointer tested is not const - it's referenced data is. Anyway, this pointed out another thing worth a warning: The static variable null_fh was meant to be const. I wonder if coccinelle has a way to figure out this pattern? I guess not. > > 289 static struct ovl_fh null_fh = { > 290 .version = OVL_FH_VERSION, > 291 .magic = OVL_FH_MAGIC, > 292 .type = FILEID_INVALID, > > vim +309 fs/overlayfs/copy_up.c > > 293 .len = sizeof(struct ovl_fh), > 294 }; > 295 > 296 static int ovl_set_lower_fh(struct dentry *dentry, struct dentry *upper) > 297 { > 298 int err; > > 299 const struct ovl_fh *fh = NULL; > 300 > 301 if (ovl_redirect_fh(dentry->d_sb)) > 302 fh = ovl_get_fh(ovl_dentry_lower(dentry)); > 303 /* > 304 * On failure to encode lower fh, store an invalid 'null' fh, so > 305 * we can always use the overlay.fh xattr to distignuish between > 306 * a copy up and a pure upper inode. If lower fs does not support > 307 * encoding fh, don't try to encode again. > 308 */ > > 309 err = PTR_ERR(fh); > 310 if (IS_ERR_OR_NULL(fh)) { > 311 if (err == -EOPNOTSUPP) { > 312 pr_warn("overlay: file handle not supported by lower - turning off redirect_fh\n"); > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation