From 43529a588316643c8e01fc78b241cd1b5aa47fe1 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Thu, 13 Aug 2015 17:03:52 +0800 Subject: [PATCH] common/ceph_fs: set mode default is -1 for func ceph_flags_to_mode. Signed-off-by: Jianpeng Ma --- src/common/ceph_fs.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/ceph_fs.cc b/src/common/ceph_fs.cc index 3172c57716249..6b69e267b70f3 100644 --- a/src/common/ceph_fs.cc +++ b/src/common/ceph_fs.cc @@ -37,7 +37,8 @@ int ceph_file_layout_is_valid(const struct ceph_file_layout *layout) int ceph_flags_to_mode(int flags) { - int mode = 0; + /* because CEPH_FILE_MODE_PIN is zero, so mode = -1 is error */ + int mode = -1; #ifdef O_DIRECTORY /* fixme */ if ((flags & O_DIRECTORY) == O_DIRECTORY) -- 2.39.5