]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/FileStore: fix to handle readdir error correctly 41080/head
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Thu, 29 Apr 2021 10:57:35 +0000 (19:57 +0900)
committerroot <root@ldev-cent8.localdomain>
Tue, 4 May 2021 01:31:59 +0000 (10:31 +0900)
commit5a6c6267a182f859471ee629b490777ee1e970dd
tree6cca36564c67fbf02cb593ca3131e42ca762db19
parente216c1ee110397eb48ef026c794021917db737f2
os/FileStore: fix to handle readdir error correctly

Currently filestore code does not handle readdir error.
As man readdir(3) says, we need to check errno after readdir
returns NULL to determine if error happens or not.

This patch fixes the all readdir() calls to check errono and
handle it appropriately:
 - FileStore.cc ... abort if EIO error happens
 - BtrfsFileStoreBAckend.cc/LFNindex.cc
                ... return error to upper layer

Without this fixes, primary PG could fail to correctly perform
backfill operation and could lead data loss propagation described
in #50558.

Fixes: https://tracker.ceph.com/issues/50558
Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
src/os/filestore/BtrfsFileStoreBackend.cc
src/os/filestore/FileStore.cc
src/os/filestore/LFNIndex.cc