From 8811df3e6d015b5bb4a77e869e35522d47720872 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Thu, 8 Jan 2015 11:51:21 +0800 Subject: [PATCH] FileStore: return error if get_index fails in lfn_open (*index).index is NULL if get_index fails, need to return error in this case. Signed-off-by: Zhiqiang Wang --- src/os/FileStore.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index d44ea82be964..191fbbf42148 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -242,6 +242,10 @@ int FileStore::lfn_open(coll_t cid, } if (!((*index).index)) { r = get_index(cid, index); + if (r < 0) { + dout(10) << __func__ << " could not get index r = " << r << dendl; + return r; + } } else { need_lock = false; } -- 2.47.3