[bug report] rbd: use watch/notify for changes in rbd header

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

 



[ This is really old.  I'm just messing with some new code.  Feel free
  to ignore these emails if you want.  - dan ]

Hello Yehuda Sadeh,

The patch 59c2be1e4d42: "rbd: use watch/notify for changes in rbd
header" from Mar 21, 2011, leads to the following static checker
warning:

	drivers/block/rbd.c:820 parse_rbd_opts_token()
	warn: dead code because of 'token < 2' and 'token > 1'

drivers/block/rbd.c
   806  static int parse_rbd_opts_token(char *c, void *private)
   807  {
   808          struct rbd_options *rbd_opts = private;
   809          substring_t argstr[MAX_OPT_ARGS];
   810          int token, intval, ret;
   811  
   812          token = match_token(c, rbd_opts_tokens, argstr);
   813          if (token < Opt_last_int) {
   814                  ret = match_int(&argstr[0], &intval);
   815                  if (ret < 0) {
   816                          pr_err("bad mount option arg (not int) at '%s'\n", c);
   817                          return ret;
   818                  }
   819                  dout("got int token %d val %d\n", token, intval);
   820          } else if (token > Opt_last_int && token < Opt_last_string) {
   821                  dout("got string token %d val %s\n", token, argstr[0].from);

Opt_last_int is 1.
Opt_last_string is 2.

token can't be greater than 1 or less than 2.  Perhaps this code is for
the future?

   822          } else {
   823                  dout("got token %d\n", token);
   824          }
   825  
   826          switch (token) {
   827          case Opt_queue_depth:
   828                  if (intval < 1) {
   829                          pr_err("queue_depth out of range\n");
   830                          return -EINVAL;
   831                  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux