summaryrefslogtreecommitdiff
path: root/src/os/FileStore.cc
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-24 15:01:39 -0700
committerSage Weil <sage@inktank.com>2012-05-24 15:01:39 -0700
commitba5406235f05cb4dec1a2c79e86417ad2917e723 (patch)
treebeadb730984cac63f8dfad439e22492e56a8d918 /src/os/FileStore.cc
parent07c9eda2b1b3b4d3afd6fbbd57a52652ad312e3b (diff)
downloadceph-ba5406235f05cb4dec1a2c79e86417ad2917e723.tar.gz
filestore: make SNAP_DESTROY ioctl check more informative
Tell user about user_subvol_rm_allowed mount option. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/os/FileStore.cc')
-rw-r--r--src/os/FileStore.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index b88ab7e56f9..6b0ae1a78f8 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -1357,19 +1357,25 @@ int FileStore::_detect_fs()
dout(0) << "mount btrfs SNAP_DESTROY is supported" << dendl;
btrfs_snap_destroy = true;
} else {
+ err = -errno;
dout(0) << "mount btrfs SNAP_DESTROY failed: " << cpp_strerror(err) << dendl;
+
+ if (err == -EPERM && getuid() != 0) {
+ dout(0) << "btrfs SNAP_DESTROY failed with EPERM as non-root; remount with -o user_subvol_rm_allowed" << dendl;
+ cerr << TEXT_YELLOW
+ << "btrfs SNAP_DESTROY failed as non-root; remount with -o user_subvol_rm_allowed"
+ << TEXT_NORMAL
+ << std::endl;
+ } else if (err == -EOPNOTSUPP) {
+ derr << "btrfs SNAP_DESTROY ioctl not supported; you need a kernel newer than 2.6.32" << dendl;
+ }
}
} else {
dout(0) << "mount btrfs SNAP_CREATE failed: " << cpp_strerror(err) << dendl;
}
if (m_filestore_btrfs_snap && !btrfs_snap_destroy) {
- dout(0) << "mount btrfs snaps enabled, but no SNAP_DESTROY ioctl (from kernel 2.6.32+); DISABLING" << dendl;
- cerr << TEXT_YELLOW
- << " ** WARNING: 'filestore btrfs snap' was enabled (for safe transactions, rollback),\n"
- << " but btrfs does not support the SNAP_DESTROY ioctl (added in\n"
- << " Linux 2.6.32). Disabling.\n"
- << TEXT_NORMAL;
+ dout(0) << "mount btrfs snaps enabled, but no SNAP_DESTROY ioctl; DISABLING" << dendl;
btrfs_stable_commits = false;
}