]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/FileStore: fix to handle readdir error correctly 41238/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:21:28 +0000 (14:21 +0300)
commit24812348070c415126d56fc009400c4442ed2e4b
treee7a4e349eba759a8814cf48cf3b54419f37971a2
parent391e9bd3efb7607c92b10a20cccbacae1a608b7f
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