From: huangjun Date: Wed, 9 Nov 2016 03:26:24 +0000 (+0800) Subject: os/filestore: avoid to get the wrong hardlink number. X-Git-Tag: v11.1.0~153^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85f1fdfc438400b1f32c1c0d704d40c6c0cecf9c;p=ceph.git os/filestore: avoid to get the wrong hardlink number. Signed-off-by: huangjun --- diff --git a/src/os/filestore/LFNIndex.cc b/src/os/filestore/LFNIndex.cc index f56c1f3c023..856fb51306b 100644 --- a/src/os/filestore/LFNIndex.cc +++ b/src/os/filestore/LFNIndex.cc @@ -790,8 +790,9 @@ int LFNIndex::lfn_get_name(const vector &path, *hardlink = 0; else return -errno; - } - *hardlink = st.st_nlink; + } else { + *hardlink = st.st_nlink; + } } return 0; }