[Bug 809221] Re: unable to mount ceph root at boot due to stripping of trailing slashes

Adam Conrad adconrad at 0c3.net
Sat Jul 28 22:30:56 UTC 2012


Damien,

I'm a bit confused by this part of the patch, which seems a bit odd to
me:

+    int devlen;
[...]
+            devlen = strlen(mnt->device);
+            if ( devlen < 2 || strcmp(mnt->device + (devlen - 2), ":/")) {
+                strip_slashes (mnt->device);
+            }

Neither part of that conditional makes a whole lot of sense to me
(though, admittedly, I know little of ceph).  If ceph doesn't need the
trailing slashes removed, why do it "sometimes"?

(1) In the first case, "if ( devlen < 2) strip_slashes()" seems to assume that the device would be "/" and we're reducing it to an empty string.  Is that a sane result?
(2) The second part of the conditional won't strip slashes from "127.0.0.1:/" (which is correct, and addresses the bug report), but would then needlessly strip slashes from "127.0.0.1:/foo/", which I'm told is pointless, since both :/foo/ and :/foo are valid device names.

Can you comment on the above notes?  If this conditional is pointless,
I'd happily remove it and sponsor the upload and SRUs to older releases.
If either of these is actually necessary, some rationale explaining the
code (maybe even some comments to throw in the code so later auditors
don't ask WTF, as I've just done) would be lovely.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to mountall in Ubuntu.
https://bugs.launchpad.net/bugs/809221

Title:
  unable to mount ceph root at boot due to stripping of trailing slashes

Status in “mountall” package in Ubuntu:
  Triaged

Bug description:
  When the mount device doesn't start with UUID= or LABEL= update_mount
  will strip the trailing slashes from the mount device name. For most
  situations this is fine but with Ceph it's quite possible that, for
  example, 192.168.0.15:/ would be an acceptable mount device but mount
  at boot fails since it passes 192.168.0.15: to mount.ceph, which then
  complains about an invalid device.

  I have attached a patch that resolves this issue. I don't know if it
  is the best way to do it but it works for me okay and shouldn't have
  an impact anywhere else.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/809221/+subscriptions




More information about the foundations-bugs mailing list