aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-07 17:38:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-07 17:38:18 -0400
commit7035cdf36d5c4d913f68ff97e1c2e5603500d946 (patch)
treeeee5680c16771cb23bc6d3a47bc7b6f350171b22 /fs/ceph/super.c
parent6432f2128414edbea5fd4f6c4fa4c28d0e1c6151 (diff)
parent6285bc231277419255f3498d3eb5ddc9f8e7fe79 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph updates from Sage Weil: "The bulk of this pull is a series from Alex that refactors and cleans up the RBD code to lay the groundwork for supporting the new image format and evolving feature set. There are also some cleanups in libceph, and for ceph there's fixed validation of file striping layouts and a bugfix in the code handling a shrinking MDS cluster." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (71 commits) ceph: avoid 32-bit page index overflow ceph: return EIO on invalid layout on GET_DATALOC ioctl rbd: BUG on invalid layout ceph: propagate layout error on osd request creation libceph: check for invalid mapping ceph: convert to use le32_add_cpu() ceph: Fix oops when handling mdsmap that decreases max_mds rbd: update remaining header fields for v2 rbd: get snapshot name for a v2 image rbd: get the snapshot context for a v2 image rbd: get image features for a v2 image rbd: get the object prefix for a v2 rbd image rbd: add code to get the size of a v2 rbd image rbd: lay out header probe infrastructure rbd: encapsulate code that gets snapshot info rbd: add an rbd features field rbd: don't use index in __rbd_add_snap_dev() rbd: kill create_snap sysfs entry rbd: define rbd_dev_image_id() rbd: define some new format constants ...
Diffstat (limited to 'fs/ceph/super.c')
-rw-r--r--fs/ceph/super.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 3a42d932637..2eb43f21132 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -307,7 +307,10 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt,
307{ 307{
308 struct ceph_mount_options *fsopt; 308 struct ceph_mount_options *fsopt;
309 const char *dev_name_end; 309 const char *dev_name_end;
310 int err = -ENOMEM; 310 int err;
311
312 if (!dev_name || !*dev_name)
313 return -EINVAL;
311 314
312 fsopt = kzalloc(sizeof(*fsopt), GFP_KERNEL); 315 fsopt = kzalloc(sizeof(*fsopt), GFP_KERNEL);
313 if (!fsopt) 316 if (!fsopt)
@@ -328,21 +331,33 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt,
328 fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT; 331 fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
329 fsopt->congestion_kb = default_congestion_kb(); 332 fsopt->congestion_kb = default_congestion_kb();
330 333
331 /* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */ 334 /*
335 * Distinguish the server list from the path in "dev_name".
336 * Internally we do not include the leading '/' in the path.
337 *
338 * "dev_name" will look like:
339 * <server_spec>[,<server_spec>...]:[<path>]
340 * where
341 * <server_spec> is <ip>[:<port>]
342 * <path> is optional, but if present must begin with '/'
343 */
344 dev_name_end = strchr(dev_name, '/');
345 if (dev_name_end) {
346 /* skip over leading '/' for path */
347 *path = dev_name_end + 1;
348 } else {
349 /* path is empty */
350 dev_name_end = dev_name + strlen(dev_name);
351 *path = dev_name_end;
352 }
332 err = -EINVAL; 353 err = -EINVAL;
333 if (!dev_name) 354 dev_name_end--; /* back up to ':' separator */
334 goto out; 355 if (*dev_name_end != ':') {
335 *path = strstr(dev_name, ":/"); 356 pr_err("device name is missing path (no : separator in %s)\n",
336 if (*path == NULL) {
337 pr_err("device name is missing path (no :/ in %s)\n",
338 dev_name); 357 dev_name);
339 goto out; 358 goto out;
340 } 359 }
341 dev_name_end = *path;
342 dout("device name '%.*s'\n", (int)(dev_name_end - dev_name), dev_name); 360 dout("device name '%.*s'\n", (int)(dev_name_end - dev_name), dev_name);
343
344 /* path on server */
345 *path += 2;
346 dout("server path '%s'\n", *path); 361 dout("server path '%s'\n", *path);
347 362
348 *popt = ceph_parse_options(options, dev_name, dev_name_end, 363 *popt = ceph_parse_options(options, dev_name, dev_name_end,