Skip to content

Commit

Permalink
Touch up comments and test naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsa committed Oct 19, 2016
1 parent fe01785 commit 02f5a3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tools/integration_tests/mount_helper_test.go
Expand Up @@ -134,10 +134,10 @@ func (t *MountHelperTest) BadUsage() {
}
}

func (t *MountHelperTest) IgnoreMtabFlag() {
func (t *MountHelperTest) NoMtabFlag() {
var err error

// Mount.
// Mount. The "-n" argument should be ignored.
args := []string{canned.FakeBucketName, t.dir, "-n"}

err = t.mount(args)
Expand Down
22 changes: 7 additions & 15 deletions tools/mount_gcsfuse/main.go
Expand Up @@ -147,21 +147,13 @@ func parseArgs(
return
}

// Work around for systemd .mount file integration with gcsfuse:
//
// systemd passes -n (alias --no-mtab) to the mount helper mount.gcsfuse
// in the case of using gcsfuse as the type of the filesystem in a
// systemd .mount file. This seems to be a result of the new setup on many
// Linux systems with /etc/mtab as a symlink pointing to /proc/self/mounts.
// /proc/self/mounts is read only so any helper that would normally
// write to /etc/mtab should be configured not to do so. Because
// systemd does not provide a way to disable this behavior
// for mount helpers that do not write to /etc/mtab, this
// workaround will allow compatibility between gcsfuse and systemd.
//
// This patch allows gcsfuse to ignore the -n flag and will
// provide an opportunity to set the filesystem type to gcsfuse in
// systemd without causing the mount helper to fail.
// systemd passes -n (alias --no-mtab) to the mount helper. This seems to
// be a result of the new setup on many Linux systems with /etc/mtab as a
// symlink pointing to /proc/self/mounts. /proc/self/mounts is read-only,
// so any helper that would normally write to /etc/mtab should be
// configured not to do so. Because systemd does not provide a way to
// disable this behavior for mount helpers that do not write to /etc/mtab,
// we ignore the flag.
case s == "-n":
continue

Expand Down

0 comments on commit 02f5a3a

Please sign in to comment.