[bug report] vfs: Add configuration parser helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello David Howells,

The patch a2312488ed30: "vfs: Add configuration parser helpers" from
Jul 25, 2018, leads to the following static checker warning:

	fs/fs_parser.c:106 fs_parse()
	warn: impossible condition '(result->key == -5678) => (0-255 == (-5678))'

fs/fs_parser.c
    80          k = __lookup_constant(desc->keys, desc->nr_keys, param->key,
    81                                -EAGAIN);
    82          if (k == -EAGAIN) {
    83                  /* If we didn't find something that looks like "noxxx", see if
    84                   * "xxx" takes the "no"-form negative - but only if there
    85                   * wasn't an value.
    86                   */
    87                  if (param->string || param->size > 0)
    88                          goto unknown_parameter;
    89                  if (param->key[0] != 'n' || param->key[1] != 'o' || !param->key[2])
    90                          goto unknown_parameter;
    91  
    92                  k = __lookup_constant(desc->keys, desc->nr_keys,
    93                                        param->key + 2, -EAGAIN);
    94                  if (k == -EAGAIN)
    95                          goto unknown_parameter;
    96                  if (!(desc->specs[k].flags & fs_param_neg_with_no))
    97                          goto unknown_parameter;
    98                  result->key = k;
    99                  result->uint_32 = 0;
   100                  result->negated = true;
   101                  goto okay;
   102          }
   103  
   104          result->key = k;
   105          result->negated = false;
   106          if (result->key == fsconfig_key_removed)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Impossible because a u8 can't be -5678.  Also it's weird that the
fsconfig_key_removed define isn't allcaps?

   107                  return invalf(fc, "%s: Unsupported parameter name '%s'",
   108                                desc->name, param->key);
   109  
   110          result->t = desc->specs[result->key];
   111          if (result->t.flags & fs_param_deprecated)
   112                  warnf(fc, "%s: Deprecated parameter '%s'",
   113                        desc->name, param->key);
   114  

regards,
dan carpenter



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux