• David Howells's avatar
    afs: Fix mountpoint parsing · 158d5833
    David Howells authored
    Each AFS mountpoint has strings that define the target to be mounted.  This
    is required to end in a dot that is supposed to be stripped off.  The
    string can include suffixes of ".readonly" or ".backup" - which are
    supposed to come before the terminal dot.  To add to the confusion, the "fs
    lsmount" afs utility does not show the terminal dot when displaying the
    string.
    
    The kernel mount source string parser, however, assumes that the terminal
    dot marks the suffix and that the suffix is always "" and is thus ignored.
    In most cases, there is no suffix and this is not a problem - but if there
    is a suffix, it is lost and this affects the ability to mount the correct
    volume.
    
    The command line mount command, on the other hand, is expected not to
    include a terminal dot - so the problem doesn't arise there.
    
    Fix this by making sure that the dot exists and then stripping it when
    passing the string to the mount configuration.
    
    Fixes: bec5eb61 ("AFS: Implement an autocell mount capability [ver #2]")
    Reported-by: default avatarJonathan Billings <jsbillings@jsbillings.org>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
    Tested-by: default avatarJonathan Billings <jsbillings@jsbillings.org>
    158d5833
mntpt.c 5.05 KB