From 839b4cacdeb9f2a77300313e3f3df2848b0c6577 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 13 Apr 2011 14:49:48 -0700 Subject: [PATCH] filestore: fix do_getxattr check Signed-off-by: Colin McCabe --- src/os/FileStore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 927279d7b5dcd..76571a151d8cb 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -874,9 +874,9 @@ int FileStore::_detect_fs() int y = x+1; snprintf(fn, sizeof(fn), "%s/fsid", basedir.c_str()); int ret = do_setxattr(fn, "user.test", &x, sizeof(x)); - if (!ret) + if (ret >= 0) ret = do_getxattr(fn, "user.test", &y, sizeof(y)); - if (ret || (x != y)) { + if ((ret < 0) || (x != y)) { derr << "Extended attributes don't appear to work. "; if (ret) *_dout << "Got error " + cpp_strerror(ret) + ". "; -- 2.39.5