Project

General

Profile

Bug #3052

ceph-osd --mkfs fails on ext3

Added by Greg Farnum over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
OSD
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

node02:/data/ceph_backend# ceph-osd -c /etc/ceph/ceph.conf -i 1 --mkfs --monmap
/tmp/monmap  --mkkey
2012-08-26 23:43:24.572064 f733e710 -1 filestore(/data/ceph_backend/osd) mkfs:
BTRFS_IOC_SUBVOL_CREATE failed with error (22) Invalid argument
2012-08-26 23:43:24.572088 f733e710 -1 OSD::mkfs: FileStore::mkfs failed with
error -22
2012-08-26 23:43:24.572104 f733e710 -1  ** ERROR: error creating empty object
store in /data/ceph_backend/osd: (22) Invalid argument

It looks as if ext3 is returning EINVAL instead of the expected EOPNOTSUPP.

Associated revisions

Revision 71cfaf1c (diff)
Added by Sage Weil over 11 years ago

os/FileStore: only try BTRFS_IOC_SUBVOL_CREATE on btrfs

Only try to create a btrfs subvolume if the fs is btrfs. Otherwise, just
create a directory. Then we can error out on any ioctl error, and not
rely on the ioctl error code to determine if we failed because we are on
a non-btrfs or a real error.

Fixes: #3052
Signed-off-by: Sage Weil <>
Reviewed-by: Dan Mick <>

History

#1 Updated by Dan Mick over 11 years ago

IRC user mrjack_ confirms that this (from Greg) fixes the problem:

diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 42f4705..d947237 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@ -1030,7 +1030,7 @ int FileStore::mkfs()
strcpy(volargs.name, "current");
if (::ioctl(basedir_fd, BTRFS_IOC_SUBVOL_CREATE, (unsigned long int)&volargs)) {
ret = -errno;
- if (ret -EOPNOTSUPP || ret -ENOTTY) {
+ if (ret < 0) {
dout(2) << " BTRFS_IOC_SUBVOL_CREATE ioctl failed, trying mkdir "
<< current_fn << dendl;
#endif

#2 Updated by Sage Weil over 11 years ago

  • Status changed from New to Fix Under Review

#3 Updated by Sage Weil over 11 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF