]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix do_getxattr check
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Apr 2011 21:49:48 +0000 (14:49 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Apr 2011 21:51:15 +0000 (14:51 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/os/FileStore.cc

index 927279d7b5dcd5a33843fddf217b783976a3397f..76571a151d8cb5e8458f283001e045dd17874be0 100644 (file)
@@ -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) + ". ";