Re: dm: impose configurable deadline for dm_request_fn's merge heuristic

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

 



Hello Mike Snitzer,

The patch 6ee47d96b97d: "dm: impose configurable deadline for
dm_request_fn's merge heuristic" from Feb 26, 2015, leads to the
following static checker warning:

	drivers/md/dm.c:1968 dm_attr_rq_based_queue_deadline_store()
	warn: impossible condition '(deadline > ((~0 >> 1))) => (s32min-s32max > s32max)'

drivers/md/dm.c
  1959  ssize_t dm_attr_rq_based_queue_deadline_store(struct mapped_device *md,
  1960                                                const char *buf, size_t count)
  1961  {
  1962          int err, deadline;
  1963  
  1964          if (!dm_request_based(md))
  1965                  return count;
  1966  
  1967          err = kstrtoint(buf, 10, &deadline);
  1968          if (err || deadline > INT_MAX)
                           ^^^^^^^^^^^^^^^^^^
Impossible condition.  But it might not hurt to test for negative
deadlines?

  1969                  return -EINVAL;
  1970  
  1971          if (!deadline)
  1972                  deadline = DEF_QUEUE_DEADLINE;
  1973          else if (deadline > MAX_QUEUE_DEADLINE)
  1974                  deadline = MAX_QUEUE_DEADLINE;
  1975  
  1976          atomic_set(&md->rq_based_queue_deadline, deadline);
  1977  
  1978          return count;
  1979  }

regards,
dan carpenter

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux