]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd: don't attempt to interpret image cache state json
authorIlya Dryomov <idryomov@gmail.com>
Thu, 6 May 2021 09:20:23 +0000 (11:20 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 11 May 2021 11:56:39 +0000 (13:56 +0200)
commita9c8aa1cc09b367aa8025ccbca58e0e50ebaa6ba
tree96d401f36369553aaf007da4415391c825e015f3
parent24216b3c5481e025e2005846ed53e61c90d50c47
rbd: don't attempt to interpret image cache state json

There are several issues with the current code:

- the value of "present" field is lost to the value of "clean" -- if the
  cache is present but dirty, we report that there is no cache
- the value of "clean" field is lost -- we always report false
- for a cache bigger than 2G, size is reported incorrectly -- 32-bit int
  overflow
- there is no way to get the type of the cache (rwl vs ssd)

Finally, even with all of the above fixed, image cache state output
would still be confusing because it is effectively a snapshot from
the time the cache was loaded.  It is not updated until the cache is
orderly closed.

Given that more changes would be needed to make "rbd status" output
useful and in the meantime it just needs to be correct to allow for
basic troubleshooting, just dump raw json.

Fixes: https://tracker.ceph.com/issues/50613
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit f70bb26a66cccf560065eb7bdf083361a1caec1a)
src/tools/rbd/action/Status.cc