Skip to content

Commit c800027

Browse files
Merge pull request #2302 from Luap99/driver-mutex
fix minor review comment about the driver mutex and a minor lint issue
2 parents 7595f18 + 0668a10 commit c800027

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ lint_task:
126126
folder: $GOPATH/pkg/mod
127127
build_script: |
128128
apt-get update
129-
apt-get install -y libbtrfs-dev
129+
apt-get install -y libbtrfs-dev libsubid-dev
130130
test_script: |
131131
make TAGS=regex_precompile local-validate
132132
make lint

drivers/overlay/overlay.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ type Driver struct {
130130
usingMetacopy bool
131131
usingComposefs bool
132132

133-
stagingDirsLocksMutex *sync.Mutex
133+
stagingDirsLocksMutex sync.Mutex
134134
// stagingDirsLocks access is not thread safe, it is required that callers take
135135
// stagingDirsLocksMutex on each access to guard against concurrent map writes.
136136
stagingDirsLocks map[string]*lockfile.LockFile
@@ -441,7 +441,7 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
441441
supportsVolatile: supportsVolatile,
442442
usingComposefs: opts.useComposefs,
443443
options: *opts,
444-
stagingDirsLocksMutex: &sync.Mutex{},
444+
stagingDirsLocksMutex: sync.Mutex{},
445445
stagingDirsLocks: make(map[string]*lockfile.LockFile),
446446
}
447447

hack/libsubid_tag.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fi
55
tmpdir="$PWD/tmp.$RANDOM"
66
mkdir -p "$tmpdir"
77
trap 'rm -fr "$tmpdir"' EXIT
8-
cc -o "$tmpdir"/libsubid_tag -l subid -x c - > /dev/null 2> /dev/null << EOF
8+
cc -o "$tmpdir"/libsubid_tag -x c - -l subid > /dev/null 2> /dev/null << EOF
99
#include <shadow/subid.h>
1010
#include <stdio.h>
1111
#include <stdlib.h>

pkg/idtools/idtools_supported.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ struct subid_range get_range(struct subid_range *ranges, int i)
2929
*/
3030
import "C"
3131

32-
var (
33-
onceInit sync.Once
34-
)
32+
var onceInit sync.Once
3533

3634
func readSubid(username string, isUser bool) (ranges, error) {
3735
var ret ranges

0 commit comments

Comments
 (0)