]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/FileStore: fix to handle readdir error correctly 41237/head
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Thu, 29 Apr 2021 10:57:35 +0000 (19:57 +0900)
committerMykola Golub <mgolub@suse.com>
Sat, 8 May 2021 11:20:42 +0000 (14:20 +0300)
commitc9177b74be26cc553b1f46950c6ae63c693261e7
tree750a7690efc57d63c21de003adbdca0807f50fde
parenta3ea99688fef1ae7c339a32fa44b59f3191230b2
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>
(cherry picked from commit 5a6c6267a182f859471ee629b490777ee1e970dd)
src/os/filestore/BtrfsFileStoreBackend.cc
src/os/filestore/FileStore.cc
src/os/filestore/LFNIndex.cc