The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3410

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Closes #3409

Signed-off-by: Stéphane Graber <[email protected]>
From 865ec4ee242c6b6e1c44f440f686d1880e48afc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Tue, 13 Jun 2017 16:02:18 -0400
Subject: [PATCH] btrfs: Apply default flags BEFORE detecting type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #3409

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/storage_btrfs.go | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lxd/storage_btrfs.go b/lxd/storage_btrfs.go
index a403b5e8e..dbe8105ba 100644
--- a/lxd/storage_btrfs.go
+++ b/lxd/storage_btrfs.go
@@ -354,7 +354,6 @@ func (s *storageBtrfs) StoragePoolMount() (bool, error) {
                }
                lxdStorageMapLock.Unlock()
        }
-
        defer removeLockFromMap()
 
        // Check whether the mount poolMntPoint exits.
@@ -369,7 +368,7 @@ func (s *storageBtrfs) StoragePoolMount() (bool, error) {
                return false, nil
        }
 
-       mountFlags := uintptr(0)
+       mountFlags, mountOptions := 
lxdResolveMountoptions(s.getBtrfsMountOptions())
        mountSource := source
        isBlockDev := shared.IsBlockdevPath(source)
        if filepath.IsAbs(source) {
@@ -391,7 +390,7 @@ func (s *storageBtrfs) StoragePoolMount() (bool, error) {
                        defer loopF.Close()
                } else if !isBlockDev && cleanSource != poolMntPoint {
                        mountSource = source
-                       mountFlags = syscall.MS_BIND
+                       mountFlags |= syscall.MS_BIND
                } else if !isBlockDev && cleanSource == poolMntPoint && 
s.d.BackingFs == "btrfs" {
                        return false, nil
                }
@@ -412,14 +411,12 @@ func (s *storageBtrfs) StoragePoolMount() (bool, error) {
                        // detection task.
                        return false, nil
                }
-
        }
 
-       mountFlags, mountOptions := 
lxdResolveMountoptions(s.getBtrfsMountOptions())
        mountFlags |= s.remount
        err := syscall.Mount(mountSource, poolMntPoint, "btrfs", mountFlags, 
mountOptions)
        if err != nil {
-               logger.Errorf("failed to mount BTRFS storage pool \"%s\" onto 
\"%s\" with mountoptions \"%s\": %s", mountSource, poolMntPoint, mountOptions, 
err)
+               logger.Errorf("Failed to mount BTRFS storage pool \"%s\" onto 
\"%s\" with mountoptions \"%s\": %s", mountSource, poolMntPoint, mountOptions, 
err)
                return false, err
        }
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to