aufs.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. // +build linux
  2. /*
  3. aufs driver directory structure
  4. .
  5. ├── layers // Metadata of layers
  6. │ ├── 1
  7. │ ├── 2
  8. │ └── 3
  9. ├── diff // Content of the layer
  10. │ ├── 1 // Contains layers that need to be mounted for the id
  11. │ ├── 2
  12. │ └── 3
  13. └── mnt // Mount points for the rw layers to be mounted
  14. ├── 1
  15. ├── 2
  16. └── 3
  17. */
  18. package aufs
  19. import (
  20. "bufio"
  21. "fmt"
  22. "io"
  23. "io/ioutil"
  24. "os"
  25. "os/exec"
  26. "path"
  27. "path/filepath"
  28. "strings"
  29. "sync"
  30. "time"
  31. "github.com/docker/docker/daemon/graphdriver"
  32. "github.com/docker/docker/pkg/archive"
  33. "github.com/docker/docker/pkg/chrootarchive"
  34. "github.com/docker/docker/pkg/containerfs"
  35. "github.com/docker/docker/pkg/directory"
  36. "github.com/docker/docker/pkg/idtools"
  37. "github.com/docker/docker/pkg/locker"
  38. mountpk "github.com/docker/docker/pkg/mount"
  39. "github.com/docker/docker/pkg/system"
  40. rsystem "github.com/opencontainers/runc/libcontainer/system"
  41. "github.com/opencontainers/selinux/go-selinux/label"
  42. "github.com/pkg/errors"
  43. "github.com/sirupsen/logrus"
  44. "github.com/vbatts/tar-split/tar/storage"
  45. "golang.org/x/sys/unix"
  46. )
  47. var (
  48. // ErrAufsNotSupported is returned if aufs is not supported by the host.
  49. ErrAufsNotSupported = fmt.Errorf("AUFS was not found in /proc/filesystems")
  50. // ErrAufsNested means aufs cannot be used bc we are in a user namespace
  51. ErrAufsNested = fmt.Errorf("AUFS cannot be used in non-init user namespace")
  52. backingFs = "<unknown>"
  53. enableDirpermLock sync.Once
  54. enableDirperm bool
  55. )
  56. func init() {
  57. graphdriver.Register("aufs", Init)
  58. }
  59. // Driver contains information about the filesystem mounted.
  60. type Driver struct {
  61. sync.Mutex
  62. root string
  63. uidMaps []idtools.IDMap
  64. gidMaps []idtools.IDMap
  65. ctr *graphdriver.RefCounter
  66. pathCacheLock sync.Mutex
  67. pathCache map[string]string
  68. naiveDiff graphdriver.DiffDriver
  69. locker *locker.Locker
  70. }
  71. // Init returns a new AUFS driver.
  72. // An error is returned if AUFS is not supported.
  73. func Init(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
  74. // Try to load the aufs kernel module
  75. if err := supportsAufs(); err != nil {
  76. return nil, graphdriver.ErrNotSupported
  77. }
  78. fsMagic, err := graphdriver.GetFSMagic(root)
  79. if err != nil {
  80. return nil, err
  81. }
  82. if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
  83. backingFs = fsName
  84. }
  85. switch fsMagic {
  86. case graphdriver.FsMagicAufs, graphdriver.FsMagicBtrfs, graphdriver.FsMagicEcryptfs:
  87. logrus.Errorf("AUFS is not supported over %s", backingFs)
  88. return nil, graphdriver.ErrIncompatibleFS
  89. }
  90. paths := []string{
  91. "mnt",
  92. "diff",
  93. "layers",
  94. }
  95. a := &Driver{
  96. root: root,
  97. uidMaps: uidMaps,
  98. gidMaps: gidMaps,
  99. pathCache: make(map[string]string),
  100. ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(graphdriver.FsMagicAufs)),
  101. locker: locker.New(),
  102. }
  103. rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)
  104. if err != nil {
  105. return nil, err
  106. }
  107. // Create the root aufs driver dir and return
  108. // if it already exists
  109. // If not populate the dir structure
  110. if err := idtools.MkdirAllAs(root, 0700, rootUID, rootGID); err != nil {
  111. if os.IsExist(err) {
  112. return a, nil
  113. }
  114. return nil, err
  115. }
  116. if err := mountpk.MakePrivate(root); err != nil {
  117. return nil, err
  118. }
  119. // Populate the dir structure
  120. for _, p := range paths {
  121. if err := idtools.MkdirAllAs(path.Join(root, p), 0700, rootUID, rootGID); err != nil {
  122. return nil, err
  123. }
  124. }
  125. logger := logrus.WithFields(logrus.Fields{
  126. "module": "graphdriver",
  127. "driver": "aufs",
  128. })
  129. for _, path := range []string{"mnt", "diff"} {
  130. p := filepath.Join(root, path)
  131. entries, err := ioutil.ReadDir(p)
  132. if err != nil {
  133. logger.WithError(err).WithField("dir", p).Error("error reading dir entries")
  134. continue
  135. }
  136. for _, entry := range entries {
  137. if !entry.IsDir() {
  138. continue
  139. }
  140. if strings.HasSuffix(entry.Name(), "-removing") {
  141. logger.WithField("dir", entry.Name()).Debug("Cleaning up stale layer dir")
  142. if err := system.EnsureRemoveAll(filepath.Join(p, entry.Name())); err != nil {
  143. logger.WithField("dir", entry.Name()).WithError(err).Error("Error removing stale layer dir")
  144. }
  145. }
  146. }
  147. }
  148. a.naiveDiff = graphdriver.NewNaiveDiffDriver(a, uidMaps, gidMaps)
  149. return a, nil
  150. }
  151. // Return a nil error if the kernel supports aufs
  152. // We cannot modprobe because inside dind modprobe fails
  153. // to run
  154. func supportsAufs() error {
  155. // We can try to modprobe aufs first before looking at
  156. // proc/filesystems for when aufs is supported
  157. exec.Command("modprobe", "aufs").Run()
  158. if rsystem.RunningInUserNS() {
  159. return ErrAufsNested
  160. }
  161. f, err := os.Open("/proc/filesystems")
  162. if err != nil {
  163. return err
  164. }
  165. defer f.Close()
  166. s := bufio.NewScanner(f)
  167. for s.Scan() {
  168. if strings.Contains(s.Text(), "aufs") {
  169. return nil
  170. }
  171. }
  172. return ErrAufsNotSupported
  173. }
  174. func (a *Driver) rootPath() string {
  175. return a.root
  176. }
  177. func (*Driver) String() string {
  178. return "aufs"
  179. }
  180. // Status returns current information about the filesystem such as root directory, number of directories mounted, etc.
  181. func (a *Driver) Status() [][2]string {
  182. ids, _ := loadIds(path.Join(a.rootPath(), "layers"))
  183. return [][2]string{
  184. {"Root Dir", a.rootPath()},
  185. {"Backing Filesystem", backingFs},
  186. {"Dirs", fmt.Sprintf("%d", len(ids))},
  187. {"Dirperm1 Supported", fmt.Sprintf("%v", useDirperm())},
  188. }
  189. }
  190. // GetMetadata not implemented
  191. func (a *Driver) GetMetadata(id string) (map[string]string, error) {
  192. return nil, nil
  193. }
  194. // Exists returns true if the given id is registered with
  195. // this driver
  196. func (a *Driver) Exists(id string) bool {
  197. if _, err := os.Lstat(path.Join(a.rootPath(), "layers", id)); err != nil {
  198. return false
  199. }
  200. return true
  201. }
  202. // CreateReadWrite creates a layer that is writable for use as a container
  203. // file system.
  204. func (a *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error {
  205. return a.Create(id, parent, opts)
  206. }
  207. // Create three folders for each id
  208. // mnt, layers, and diff
  209. func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
  210. if opts != nil && len(opts.StorageOpt) != 0 {
  211. return fmt.Errorf("--storage-opt is not supported for aufs")
  212. }
  213. if err := a.createDirsFor(id); err != nil {
  214. return err
  215. }
  216. // Write the layers metadata
  217. f, err := os.Create(path.Join(a.rootPath(), "layers", id))
  218. if err != nil {
  219. return err
  220. }
  221. defer f.Close()
  222. if parent != "" {
  223. ids, err := getParentIDs(a.rootPath(), parent)
  224. if err != nil {
  225. return err
  226. }
  227. if _, err := fmt.Fprintln(f, parent); err != nil {
  228. return err
  229. }
  230. for _, i := range ids {
  231. if _, err := fmt.Fprintln(f, i); err != nil {
  232. return err
  233. }
  234. }
  235. }
  236. return nil
  237. }
  238. // createDirsFor creates two directories for the given id.
  239. // mnt and diff
  240. func (a *Driver) createDirsFor(id string) error {
  241. paths := []string{
  242. "mnt",
  243. "diff",
  244. }
  245. rootUID, rootGID, err := idtools.GetRootUIDGID(a.uidMaps, a.gidMaps)
  246. if err != nil {
  247. return err
  248. }
  249. // Directory permission is 0755.
  250. // The path of directories are <aufs_root_path>/mnt/<image_id>
  251. // and <aufs_root_path>/diff/<image_id>
  252. for _, p := range paths {
  253. if err := idtools.MkdirAllAs(path.Join(a.rootPath(), p, id), 0755, rootUID, rootGID); err != nil {
  254. return err
  255. }
  256. }
  257. return nil
  258. }
  259. // Remove will unmount and remove the given id.
  260. func (a *Driver) Remove(id string) error {
  261. a.locker.Lock(id)
  262. defer a.locker.Unlock(id)
  263. a.pathCacheLock.Lock()
  264. mountpoint, exists := a.pathCache[id]
  265. a.pathCacheLock.Unlock()
  266. if !exists {
  267. mountpoint = a.getMountpoint(id)
  268. }
  269. logger := logrus.WithFields(logrus.Fields{
  270. "module": "graphdriver",
  271. "driver": "aufs",
  272. "layer": id,
  273. })
  274. var retries int
  275. for {
  276. mounted, err := a.mounted(mountpoint)
  277. if err != nil {
  278. if os.IsNotExist(err) {
  279. break
  280. }
  281. return err
  282. }
  283. if !mounted {
  284. break
  285. }
  286. err = a.unmount(mountpoint)
  287. if err == nil {
  288. break
  289. }
  290. if err != unix.EBUSY {
  291. return errors.Wrapf(err, "aufs: unmount error: %s", mountpoint)
  292. }
  293. if retries >= 5 {
  294. return errors.Wrapf(err, "aufs: unmount error after retries: %s", mountpoint)
  295. }
  296. // If unmount returns EBUSY, it could be a transient error. Sleep and retry.
  297. retries++
  298. logger.Warnf("unmount failed due to EBUSY: retry count: %d", retries)
  299. time.Sleep(100 * time.Millisecond)
  300. }
  301. // Remove the layers file for the id
  302. if err := os.Remove(path.Join(a.rootPath(), "layers", id)); err != nil && !os.IsNotExist(err) {
  303. return errors.Wrapf(err, "error removing layers dir for %s", id)
  304. }
  305. if err := atomicRemove(a.getDiffPath(id)); err != nil {
  306. return errors.Wrapf(err, "could not remove diff path for id %s", id)
  307. }
  308. // Atomically remove each directory in turn by first moving it out of the
  309. // way (so that docker doesn't find it anymore) before doing removal of
  310. // the whole tree.
  311. if err := atomicRemove(mountpoint); err != nil {
  312. if errors.Cause(err) == unix.EBUSY {
  313. logger.WithField("dir", mountpoint).WithError(err).Warn("error performing atomic remove due to EBUSY")
  314. }
  315. return errors.Wrapf(err, "could not remove mountpoint for id %s", id)
  316. }
  317. a.pathCacheLock.Lock()
  318. delete(a.pathCache, id)
  319. a.pathCacheLock.Unlock()
  320. return nil
  321. }
  322. func atomicRemove(source string) error {
  323. target := source + "-removing"
  324. err := os.Rename(source, target)
  325. switch {
  326. case err == nil, os.IsNotExist(err):
  327. case os.IsExist(err):
  328. // Got error saying the target dir already exists, maybe the source doesn't exist due to a previous (failed) remove
  329. if _, e := os.Stat(source); !os.IsNotExist(e) {
  330. return errors.Wrapf(err, "target rename dir '%s' exists but should not, this needs to be manually cleaned up")
  331. }
  332. default:
  333. return errors.Wrapf(err, "error preparing atomic delete")
  334. }
  335. return system.EnsureRemoveAll(target)
  336. }
  337. // Get returns the rootfs path for the id.
  338. // This will mount the dir at its given path
  339. func (a *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
  340. a.locker.Lock(id)
  341. defer a.locker.Unlock(id)
  342. parents, err := a.getParentLayerPaths(id)
  343. if err != nil && !os.IsNotExist(err) {
  344. return nil, err
  345. }
  346. a.pathCacheLock.Lock()
  347. m, exists := a.pathCache[id]
  348. a.pathCacheLock.Unlock()
  349. if !exists {
  350. m = a.getDiffPath(id)
  351. if len(parents) > 0 {
  352. m = a.getMountpoint(id)
  353. }
  354. }
  355. if count := a.ctr.Increment(m); count > 1 {
  356. return containerfs.NewLocalContainerFS(m), nil
  357. }
  358. // If a dir does not have a parent ( no layers )do not try to mount
  359. // just return the diff path to the data
  360. if len(parents) > 0 {
  361. if err := a.mount(id, m, mountLabel, parents); err != nil {
  362. return nil, err
  363. }
  364. }
  365. a.pathCacheLock.Lock()
  366. a.pathCache[id] = m
  367. a.pathCacheLock.Unlock()
  368. return containerfs.NewLocalContainerFS(m), nil
  369. }
  370. // Put unmounts and updates list of active mounts.
  371. func (a *Driver) Put(id string) error {
  372. a.locker.Lock(id)
  373. defer a.locker.Unlock(id)
  374. a.pathCacheLock.Lock()
  375. m, exists := a.pathCache[id]
  376. if !exists {
  377. m = a.getMountpoint(id)
  378. a.pathCache[id] = m
  379. }
  380. a.pathCacheLock.Unlock()
  381. if count := a.ctr.Decrement(m); count > 0 {
  382. return nil
  383. }
  384. err := a.unmount(m)
  385. if err != nil {
  386. logrus.Debugf("Failed to unmount %s aufs: %v", id, err)
  387. }
  388. return err
  389. }
  390. // isParent returns if the passed in parent is the direct parent of the passed in layer
  391. func (a *Driver) isParent(id, parent string) bool {
  392. parents, _ := getParentIDs(a.rootPath(), id)
  393. if parent == "" && len(parents) > 0 {
  394. return false
  395. }
  396. return !(len(parents) > 0 && parent != parents[0])
  397. }
  398. // Diff produces an archive of the changes between the specified
  399. // layer and its parent layer which may be "".
  400. func (a *Driver) Diff(id, parent string) (io.ReadCloser, error) {
  401. if !a.isParent(id, parent) {
  402. return a.naiveDiff.Diff(id, parent)
  403. }
  404. // AUFS doesn't need the parent layer to produce a diff.
  405. return archive.TarWithOptions(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
  406. Compression: archive.Uncompressed,
  407. ExcludePatterns: []string{archive.WhiteoutMetaPrefix + "*", "!" + archive.WhiteoutOpaqueDir},
  408. UIDMaps: a.uidMaps,
  409. GIDMaps: a.gidMaps,
  410. })
  411. }
  412. type fileGetNilCloser struct {
  413. storage.FileGetter
  414. }
  415. func (f fileGetNilCloser) Close() error {
  416. return nil
  417. }
  418. // DiffGetter returns a FileGetCloser that can read files from the directory that
  419. // contains files for the layer differences. Used for direct access for tar-split.
  420. func (a *Driver) DiffGetter(id string) (graphdriver.FileGetCloser, error) {
  421. p := path.Join(a.rootPath(), "diff", id)
  422. return fileGetNilCloser{storage.NewPathFileGetter(p)}, nil
  423. }
  424. func (a *Driver) applyDiff(id string, diff io.Reader) error {
  425. return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
  426. UIDMaps: a.uidMaps,
  427. GIDMaps: a.gidMaps,
  428. })
  429. }
  430. // DiffSize calculates the changes between the specified id
  431. // and its parent and returns the size in bytes of the changes
  432. // relative to its base filesystem directory.
  433. func (a *Driver) DiffSize(id, parent string) (size int64, err error) {
  434. if !a.isParent(id, parent) {
  435. return a.naiveDiff.DiffSize(id, parent)
  436. }
  437. // AUFS doesn't need the parent layer to calculate the diff size.
  438. return directory.Size(path.Join(a.rootPath(), "diff", id))
  439. }
  440. // ApplyDiff extracts the changeset from the given diff into the
  441. // layer with the specified id and parent, returning the size of the
  442. // new layer in bytes.
  443. func (a *Driver) ApplyDiff(id, parent string, diff io.Reader) (size int64, err error) {
  444. if !a.isParent(id, parent) {
  445. return a.naiveDiff.ApplyDiff(id, parent, diff)
  446. }
  447. // AUFS doesn't need the parent id to apply the diff if it is the direct parent.
  448. if err = a.applyDiff(id, diff); err != nil {
  449. return
  450. }
  451. return a.DiffSize(id, parent)
  452. }
  453. // Changes produces a list of changes between the specified layer
  454. // and its parent layer. If parent is "", then all changes will be ADD changes.
  455. func (a *Driver) Changes(id, parent string) ([]archive.Change, error) {
  456. if !a.isParent(id, parent) {
  457. return a.naiveDiff.Changes(id, parent)
  458. }
  459. // AUFS doesn't have snapshots, so we need to get changes from all parent
  460. // layers.
  461. layers, err := a.getParentLayerPaths(id)
  462. if err != nil {
  463. return nil, err
  464. }
  465. return archive.Changes(layers, path.Join(a.rootPath(), "diff", id))
  466. }
  467. func (a *Driver) getParentLayerPaths(id string) ([]string, error) {
  468. parentIds, err := getParentIDs(a.rootPath(), id)
  469. if err != nil {
  470. return nil, err
  471. }
  472. layers := make([]string, len(parentIds))
  473. // Get the diff paths for all the parent ids
  474. for i, p := range parentIds {
  475. layers[i] = path.Join(a.rootPath(), "diff", p)
  476. }
  477. return layers, nil
  478. }
  479. func (a *Driver) mount(id string, target string, mountLabel string, layers []string) error {
  480. a.Lock()
  481. defer a.Unlock()
  482. // If the id is mounted or we get an error return
  483. if mounted, err := a.mounted(target); err != nil || mounted {
  484. return err
  485. }
  486. rw := a.getDiffPath(id)
  487. if err := a.aufsMount(layers, rw, target, mountLabel); err != nil {
  488. return fmt.Errorf("error creating aufs mount to %s: %v", target, err)
  489. }
  490. return nil
  491. }
  492. func (a *Driver) unmount(mountPath string) error {
  493. a.Lock()
  494. defer a.Unlock()
  495. if mounted, err := a.mounted(mountPath); err != nil || !mounted {
  496. return err
  497. }
  498. if err := Unmount(mountPath); err != nil {
  499. return err
  500. }
  501. return nil
  502. }
  503. func (a *Driver) mounted(mountpoint string) (bool, error) {
  504. return graphdriver.Mounted(graphdriver.FsMagicAufs, mountpoint)
  505. }
  506. // Cleanup aufs and unmount all mountpoints
  507. func (a *Driver) Cleanup() error {
  508. var dirs []string
  509. if err := filepath.Walk(a.mntPath(), func(path string, info os.FileInfo, err error) error {
  510. if err != nil {
  511. return err
  512. }
  513. if !info.IsDir() {
  514. return nil
  515. }
  516. dirs = append(dirs, path)
  517. return nil
  518. }); err != nil {
  519. return err
  520. }
  521. for _, m := range dirs {
  522. if err := a.unmount(m); err != nil {
  523. logrus.Debugf("aufs error unmounting %s: %s", m, err)
  524. }
  525. }
  526. return mountpk.Unmount(a.root)
  527. }
  528. func (a *Driver) aufsMount(ro []string, rw, target, mountLabel string) (err error) {
  529. defer func() {
  530. if err != nil {
  531. Unmount(target)
  532. }
  533. }()
  534. // Mount options are clipped to page size(4096 bytes). If there are more
  535. // layers then these are remounted individually using append.
  536. offset := 54
  537. if useDirperm() {
  538. offset += len(",dirperm1")
  539. }
  540. b := make([]byte, unix.Getpagesize()-len(mountLabel)-offset) // room for xino & mountLabel
  541. bp := copy(b, fmt.Sprintf("br:%s=rw", rw))
  542. index := 0
  543. for ; index < len(ro); index++ {
  544. layer := fmt.Sprintf(":%s=ro+wh", ro[index])
  545. if bp+len(layer) > len(b) {
  546. break
  547. }
  548. bp += copy(b[bp:], layer)
  549. }
  550. opts := "dio,xino=/dev/shm/aufs.xino"
  551. if useDirperm() {
  552. opts += ",dirperm1"
  553. }
  554. data := label.FormatMountLabel(fmt.Sprintf("%s,%s", string(b[:bp]), opts), mountLabel)
  555. if err = mount("none", target, "aufs", 0, data); err != nil {
  556. return
  557. }
  558. for ; index < len(ro); index++ {
  559. layer := fmt.Sprintf(":%s=ro+wh", ro[index])
  560. data := label.FormatMountLabel(fmt.Sprintf("append%s", layer), mountLabel)
  561. if err = mount("none", target, "aufs", unix.MS_REMOUNT, data); err != nil {
  562. return
  563. }
  564. }
  565. return
  566. }
  567. // useDirperm checks dirperm1 mount option can be used with the current
  568. // version of aufs.
  569. func useDirperm() bool {
  570. enableDirpermLock.Do(func() {
  571. base, err := ioutil.TempDir("", "docker-aufs-base")
  572. if err != nil {
  573. logrus.Errorf("error checking dirperm1: %v", err)
  574. return
  575. }
  576. defer os.RemoveAll(base)
  577. union, err := ioutil.TempDir("", "docker-aufs-union")
  578. if err != nil {
  579. logrus.Errorf("error checking dirperm1: %v", err)
  580. return
  581. }
  582. defer os.RemoveAll(union)
  583. opts := fmt.Sprintf("br:%s,dirperm1,xino=/dev/shm/aufs.xino", base)
  584. if err := mount("none", union, "aufs", 0, opts); err != nil {
  585. return
  586. }
  587. enableDirperm = true
  588. if err := Unmount(union); err != nil {
  589. logrus.Errorf("error checking dirperm1: failed to unmount %v", err)
  590. }
  591. })
  592. return enableDirperm
  593. }