]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: make writesame get all zeros with rbd_skip_partial_discard on
authorGui Hecheng <guihecheng@cmss.chinamobile.com>
Wed, 22 Feb 2017 09:24:33 +0000 (17:24 +0800)
committerGui Hecheng <guihecheng@cmss.chinamobile.com>
Thu, 23 Feb 2017 16:16:46 +0000 (00:16 +0800)
commit6d024c5dae648b4958685a9f0df3e193e2759723
tree5af8e964d23751258c7a91b3cb9797d1a7f7112a
parent3550fe4f216ba1e4d5e1054e8052b363a35619cb
librbd: make writesame get all zeros with rbd_skip_partial_discard on

Now writesame tends to do a discard on all zero buffer, but
if rbd_skip_partial_discard is turned on, discard will not do any
zeroing work on partial discard, so we read random data while expecting
all zeros.
To fix it, we introduce the ImageCtx::skip_partial_discard and
pass an extra parameter to discard. Writesame will always pass false
and other discards will pass the ImageCtx::skip_partial_discard
which is set by the rbd_skip_partial_discard option.

Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
24 files changed:
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/cache/ImageCache.h
src/librbd/cache/ImageWriteback.cc
src/librbd/cache/ImageWriteback.h
src/librbd/cache/PassthroughImageCache.cc
src/librbd/cache/PassthroughImageCache.h
src/librbd/io/ImageRequest.cc
src/librbd/io/ImageRequest.h
src/librbd/io/ImageRequestWQ.cc
src/librbd/io/ImageRequestWQ.h
src/librbd/journal/Replay.cc
src/librbd/journal/Types.cc
src/librbd/journal/Types.h
src/librbd/librbd.cc
src/test/librbd/io/test_mock_ImageRequest.cc
src/test/librbd/journal/test_Entries.cc
src/test/librbd/journal/test_Replay.cc
src/test/librbd/journal/test_mock_Replay.cc
src/test/librbd/mock/cache/MockImageCache.h
src/test/librbd/test_internal.cc
src/test/rbd_mirror/image_sync/test_mock_ObjectCopyRequest.cc
src/test/rbd_mirror/test_ImageSync.cc
src/test/rbd_mirror/test_mock_ImageReplayer.cc