]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: print out BTRFS_IOC_SNAP_CREATE errs
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 4 Aug 2011 00:56:19 +0000 (17:56 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 4 Aug 2011 00:56:19 +0000 (17:56 -0700)
Print out the errno for BTRFS_IOC_SNAP_CREATE errors if they happen.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/os/FileStore.cc

index 005fa359b76640cb697f0e192a041b9beb2574d3..db73dcbe51271c093a3042bcc846def999179127 100644 (file)
@@ -3171,8 +3171,12 @@ void FileStore::sync_entry()
          dout(10) << "taking snap '" << vol_args.name << "'" << dendl;
          int r = ::ioctl(basedir_fd, BTRFS_IOC_SNAP_CREATE, &vol_args);
          char buf[100];
-         dout(20) << "snap create '" << vol_args.name << "' got " << r
-                  << " " << strerror_r(r < 0 ? errno : 0, buf, sizeof(buf)) << dendl;
+         if (r != 0) {
+           int err = errno;
+           derr << "snap create '" << vol_args.name << "' got error " << err << dendl;
+           assert(r == 0);
+         }
+         dout(20) << "snap create '" << vol_args.name << "' succeeded." << dendl;
          assert(r == 0);
          snaps.push_back(cp);