Now all of the storage drivers use the field "storage-driver" in their log
messages, which is set to name of the respective driver.
Storage drivers changed:
- Aufs
- Btrfs
- Devicemapper
- Overlay
- Overlay 2
- Zfs
Signed-off-by: Alejandro GonzÃlez Hevia <alejandrgh11@gmail.com>
| ... | ... |
@@ -108,7 +108,7 @@ func Init(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 108 | 108 |
|
| 109 | 109 |
switch fsMagic {
|
| 110 | 110 |
case graphdriver.FsMagicAufs, graphdriver.FsMagicBtrfs, graphdriver.FsMagicEcryptfs: |
| 111 |
- logrus.Errorf("AUFS is not supported over %s", backingFs)
|
|
| 111 |
+ logrus.WithField("storage-driver", "aufs").Errorf("AUFS is not supported over %s", backingFs)
|
|
| 112 | 112 |
return nil, graphdriver.ErrIncompatibleFS |
| 113 | 113 |
} |
| 114 | 114 |
|
| ... | ... |
@@ -142,10 +142,7 @@ func Init(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 142 | 142 |
return nil, err |
| 143 | 143 |
} |
| 144 | 144 |
} |
| 145 |
- logger := logrus.WithFields(logrus.Fields{
|
|
| 146 |
- "module": "graphdriver", |
|
| 147 |
- "driver": "aufs", |
|
| 148 |
- }) |
|
| 145 |
+ logger := logrus.WithField("storage-driver", "aufs")
|
|
| 149 | 146 |
|
| 150 | 147 |
for _, path := range []string{"mnt", "diff"} {
|
| 151 | 148 |
p := filepath.Join(root, path) |
| ... | ... |
@@ -309,9 +306,8 @@ func (a *Driver) Remove(id string) error {
|
| 309 | 309 |
} |
| 310 | 310 |
|
| 311 | 311 |
logger := logrus.WithFields(logrus.Fields{
|
| 312 |
- "module": "graphdriver", |
|
| 313 |
- "driver": "aufs", |
|
| 314 |
- "layer": id, |
|
| 312 |
+ "storage-driver": "aufs", |
|
| 313 |
+ "layer": id, |
|
| 315 | 314 |
}) |
| 316 | 315 |
|
| 317 | 316 |
var retries int |
| ... | ... |
@@ -442,7 +438,7 @@ func (a *Driver) Put(id string) error {
|
| 442 | 442 |
|
| 443 | 443 |
err := a.unmount(m) |
| 444 | 444 |
if err != nil {
|
| 445 |
- logrus.Debugf("Failed to unmount %s aufs: %v", id, err)
|
|
| 445 |
+ logrus.WithField("storage-driver", "aufs").Debugf("Failed to unmount %s aufs: %v", id, err)
|
|
| 446 | 446 |
} |
| 447 | 447 |
return err |
| 448 | 448 |
} |
| ... | ... |
@@ -600,7 +596,7 @@ func (a *Driver) Cleanup() error {
|
| 600 | 600 |
|
| 601 | 601 |
for _, m := range dirs {
|
| 602 | 602 |
if err := a.unmount(m); err != nil {
|
| 603 |
- logrus.Debugf("aufs error unmounting %s: %s", m, err)
|
|
| 603 |
+ logrus.WithField("storage-driver", "aufs").Debugf("error unmounting %s: %s", m, err)
|
|
| 604 | 604 |
} |
| 605 | 605 |
} |
| 606 | 606 |
return mountpk.RecursiveUnmount(a.root) |
| ... | ... |
@@ -655,17 +651,18 @@ func (a *Driver) aufsMount(ro []string, rw, target, mountLabel string) (err erro |
| 655 | 655 |
// useDirperm checks dirperm1 mount option can be used with the current |
| 656 | 656 |
// version of aufs. |
| 657 | 657 |
func useDirperm() bool {
|
| 658 |
+ logger := logrus.WithField("storage-driver", "aufs")
|
|
| 658 | 659 |
enableDirpermLock.Do(func() {
|
| 659 | 660 |
base, err := ioutil.TempDir("", "docker-aufs-base")
|
| 660 | 661 |
if err != nil {
|
| 661 |
- logrus.Errorf("error checking dirperm1: %v", err)
|
|
| 662 |
+ logger.Errorf("error checking dirperm1: %v", err)
|
|
| 662 | 663 |
return |
| 663 | 664 |
} |
| 664 | 665 |
defer os.RemoveAll(base) |
| 665 | 666 |
|
| 666 | 667 |
union, err := ioutil.TempDir("", "docker-aufs-union")
|
| 667 | 668 |
if err != nil {
|
| 668 |
- logrus.Errorf("error checking dirperm1: %v", err)
|
|
| 669 |
+ logger.Errorf("error checking dirperm1: %v", err)
|
|
| 669 | 670 |
return |
| 670 | 671 |
} |
| 671 | 672 |
defer os.RemoveAll(union) |
| ... | ... |
@@ -676,7 +673,7 @@ func useDirperm() bool {
|
| 676 | 676 |
} |
| 677 | 677 |
enableDirperm = true |
| 678 | 678 |
if err := Unmount(union); err != nil {
|
| 679 |
- logrus.Errorf("error checking dirperm1: failed to unmount %v", err)
|
|
| 679 |
+ logger.Errorf("error checking dirperm1: failed to unmount %v", err)
|
|
| 680 | 680 |
} |
| 681 | 681 |
}) |
| 682 | 682 |
return enableDirperm |
| ... | ... |
@@ -12,7 +12,7 @@ import ( |
| 12 | 12 |
// Unmount the target specified. |
| 13 | 13 |
func Unmount(target string) error {
|
| 14 | 14 |
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
|
| 15 |
- logrus.Warnf("Couldn't run auplink before unmount %s: %s", target, err)
|
|
| 15 |
+ logrus.WithField("storage-driver", "aufs").Warnf("Couldn't run auplink before unmount %s: %s", target, err)
|
|
| 16 | 16 |
} |
| 17 | 17 |
return unix.Unmount(target, 0) |
| 18 | 18 |
} |
| ... | ... |
@@ -291,10 +291,10 @@ func subvolDelete(dirpath, name string, quotaEnabled bool) error {
|
| 291 | 291 |
_, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_CREATE, |
| 292 | 292 |
uintptr(unsafe.Pointer(&args))) |
| 293 | 293 |
if errno != 0 {
|
| 294 |
- logrus.Errorf("Failed to delete btrfs qgroup %v for %s: %v", qgroupid, fullPath, errno.Error())
|
|
| 294 |
+ logrus.WithField("storage-driver", "btrfs").Errorf("Failed to delete btrfs qgroup %v for %s: %v", qgroupid, fullPath, errno.Error())
|
|
| 295 | 295 |
} |
| 296 | 296 |
} else {
|
| 297 |
- logrus.Errorf("Failed to lookup btrfs qgroup for %s: %v", fullPath, err.Error())
|
|
| 297 |
+ logrus.WithField("storage-driver", "btrfs").Errorf("Failed to lookup btrfs qgroup for %s: %v", fullPath, err.Error())
|
|
| 298 | 298 |
} |
| 299 | 299 |
} |
| 300 | 300 |
|
| ... | ... |
@@ -276,7 +276,7 @@ func (devices *DeviceSet) ensureImage(name string, size int64) (string, error) {
|
| 276 | 276 |
if !os.IsNotExist(err) {
|
| 277 | 277 |
return "", err |
| 278 | 278 |
} |
| 279 |
- logrus.Debugf("devmapper: Creating loopback file %s for device-manage use", filename)
|
|
| 279 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Creating loopback file %s for device-manage use", filename)
|
|
| 280 | 280 |
file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0600) |
| 281 | 281 |
if err != nil {
|
| 282 | 282 |
return "", err |
| ... | ... |
@@ -297,7 +297,7 @@ func (devices *DeviceSet) ensureImage(name string, size int64) (string, error) {
|
| 297 | 297 |
return "", fmt.Errorf("devmapper: Unable to grow loopback file %s: %v", filename, err)
|
| 298 | 298 |
} |
| 299 | 299 |
} else if fi.Size() > size {
|
| 300 |
- logrus.Warnf("devmapper: Can't shrink loopback file %s", filename)
|
|
| 300 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("Can't shrink loopback file %s", filename)
|
|
| 301 | 301 |
} |
| 302 | 302 |
} |
| 303 | 303 |
return filename, nil |
| ... | ... |
@@ -403,39 +403,40 @@ func (devices *DeviceSet) lookupDeviceWithLock(hash string) (*devInfo, error) {
|
| 403 | 403 |
// This function relies on that device hash map has been loaded in advance. |
| 404 | 404 |
// Should be called with devices.Lock() held. |
| 405 | 405 |
func (devices *DeviceSet) constructDeviceIDMap() {
|
| 406 |
- logrus.Debug("devmapper: constructDeviceIDMap()")
|
|
| 407 |
- defer logrus.Debug("devmapper: constructDeviceIDMap() END")
|
|
| 406 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("constructDeviceIDMap()")
|
|
| 407 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debug("constructDeviceIDMap() END")
|
|
| 408 | 408 |
|
| 409 | 409 |
for _, info := range devices.Devices {
|
| 410 | 410 |
devices.markDeviceIDUsed(info.DeviceID) |
| 411 |
- logrus.Debugf("devmapper: Added deviceId=%d to DeviceIdMap", info.DeviceID)
|
|
| 411 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Added deviceId=%d to DeviceIdMap", info.DeviceID)
|
|
| 412 | 412 |
} |
| 413 | 413 |
} |
| 414 | 414 |
|
| 415 | 415 |
func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo) error {
|
| 416 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 416 | 417 |
|
| 417 | 418 |
// Skip some of the meta files which are not device files. |
| 418 | 419 |
if strings.HasSuffix(finfo.Name(), ".migrated") {
|
| 419 |
- logrus.Debugf("devmapper: Skipping file %s", path)
|
|
| 420 |
+ logger.Debugf("Skipping file %s", path)
|
|
| 420 | 421 |
return nil |
| 421 | 422 |
} |
| 422 | 423 |
|
| 423 | 424 |
if strings.HasPrefix(finfo.Name(), ".") {
|
| 424 |
- logrus.Debugf("devmapper: Skipping file %s", path)
|
|
| 425 |
+ logger.Debugf("Skipping file %s", path)
|
|
| 425 | 426 |
return nil |
| 426 | 427 |
} |
| 427 | 428 |
|
| 428 | 429 |
if finfo.Name() == deviceSetMetaFile {
|
| 429 |
- logrus.Debugf("devmapper: Skipping file %s", path)
|
|
| 430 |
+ logger.Debugf("Skipping file %s", path)
|
|
| 430 | 431 |
return nil |
| 431 | 432 |
} |
| 432 | 433 |
|
| 433 | 434 |
if finfo.Name() == transactionMetaFile {
|
| 434 |
- logrus.Debugf("devmapper: Skipping file %s", path)
|
|
| 435 |
+ logger.Debugf("Skipping file %s", path)
|
|
| 435 | 436 |
return nil |
| 436 | 437 |
} |
| 437 | 438 |
|
| 438 |
- logrus.Debugf("devmapper: Loading data for file %s", path)
|
|
| 439 |
+ logger.Debugf("Loading data for file %s", path)
|
|
| 439 | 440 |
|
| 440 | 441 |
hash := finfo.Name() |
| 441 | 442 |
if hash == "base" {
|
| ... | ... |
@@ -452,12 +453,12 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo) |
| 452 | 452 |
} |
| 453 | 453 |
|
| 454 | 454 |
func (devices *DeviceSet) loadDeviceFilesOnStart() error {
|
| 455 |
- logrus.Debug("devmapper: loadDeviceFilesOnStart()")
|
|
| 456 |
- defer logrus.Debug("devmapper: loadDeviceFilesOnStart() END")
|
|
| 455 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("loadDeviceFilesOnStart()")
|
|
| 456 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debug("loadDeviceFilesOnStart() END")
|
|
| 457 | 457 |
|
| 458 | 458 |
var scan = func(path string, info os.FileInfo, err error) error {
|
| 459 | 459 |
if err != nil {
|
| 460 |
- logrus.Debugf("devmapper: Can't walk the file %s", path)
|
|
| 460 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Can't walk the file %s", path)
|
|
| 461 | 461 |
return nil |
| 462 | 462 |
} |
| 463 | 463 |
|
| ... | ... |
@@ -474,7 +475,7 @@ func (devices *DeviceSet) loadDeviceFilesOnStart() error {
|
| 474 | 474 |
|
| 475 | 475 |
// Should be called with devices.Lock() held. |
| 476 | 476 |
func (devices *DeviceSet) unregisterDevice(hash string) error {
|
| 477 |
- logrus.Debugf("devmapper: unregisterDevice(%v)", hash)
|
|
| 477 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("unregisterDevice(%v)", hash)
|
|
| 478 | 478 |
info := &devInfo{
|
| 479 | 479 |
Hash: hash, |
| 480 | 480 |
} |
| ... | ... |
@@ -482,7 +483,7 @@ func (devices *DeviceSet) unregisterDevice(hash string) error {
|
| 482 | 482 |
delete(devices.Devices, hash) |
| 483 | 483 |
|
| 484 | 484 |
if err := devices.removeMetadata(info); err != nil {
|
| 485 |
- logrus.Debugf("devmapper: Error removing metadata: %s", err)
|
|
| 485 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Error removing metadata: %s", err)
|
|
| 486 | 486 |
return err |
| 487 | 487 |
} |
| 488 | 488 |
|
| ... | ... |
@@ -491,7 +492,7 @@ func (devices *DeviceSet) unregisterDevice(hash string) error {
|
| 491 | 491 |
|
| 492 | 492 |
// Should be called with devices.Lock() held. |
| 493 | 493 |
func (devices *DeviceSet) registerDevice(id int, hash string, size uint64, transactionID uint64) (*devInfo, error) {
|
| 494 |
- logrus.Debugf("devmapper: registerDevice(%v, %v)", id, hash)
|
|
| 494 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("registerDevice(%v, %v)", id, hash)
|
|
| 495 | 495 |
info := &devInfo{
|
| 496 | 496 |
Hash: hash, |
| 497 | 497 |
DeviceID: id, |
| ... | ... |
@@ -513,7 +514,7 @@ func (devices *DeviceSet) registerDevice(id int, hash string, size uint64, trans |
| 513 | 513 |
} |
| 514 | 514 |
|
| 515 | 515 |
func (devices *DeviceSet) activateDeviceIfNeeded(info *devInfo, ignoreDeleted bool) error {
|
| 516 |
- logrus.Debugf("devmapper: activateDeviceIfNeeded(%v)", info.Hash)
|
|
| 516 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("activateDeviceIfNeeded(%v)", info.Hash)
|
|
| 517 | 517 |
|
| 518 | 518 |
if info.Deleted && !ignoreDeleted {
|
| 519 | 519 |
return fmt.Errorf("devmapper: Can't activate device %v as it is marked for deletion", info.Hash)
|
| ... | ... |
@@ -568,7 +569,7 @@ func determineDefaultFS() string {
|
| 568 | 568 |
return "xfs" |
| 569 | 569 |
} |
| 570 | 570 |
|
| 571 |
- logrus.Warnf("devmapper: XFS is not supported in your system (%v). Defaulting to ext4 filesystem", err)
|
|
| 571 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("XFS is not supported in your system (%v). Defaulting to ext4 filesystem", err)
|
|
| 572 | 572 |
return "ext4" |
| 573 | 573 |
} |
| 574 | 574 |
|
| ... | ... |
@@ -597,12 +598,12 @@ func (devices *DeviceSet) createFilesystem(info *devInfo) (err error) {
|
| 597 | 597 |
args = append(args, devices.mkfsArgs...) |
| 598 | 598 |
args = append(args, devname) |
| 599 | 599 |
|
| 600 |
- logrus.Infof("devmapper: Creating filesystem %s on device %s, mkfs args: %v", devices.filesystem, info.Name(), args)
|
|
| 600 |
+ logrus.WithField("storage-driver", "devicemapper").Infof("Creating filesystem %s on device %s, mkfs args: %v", devices.filesystem, info.Name(), args)
|
|
| 601 | 601 |
defer func() {
|
| 602 | 602 |
if err != nil {
|
| 603 |
- logrus.Infof("devmapper: Error while creating filesystem %s on device %s: %v", devices.filesystem, info.Name(), err)
|
|
| 603 |
+ logrus.WithField("storage-driver", "devicemapper").Infof("Error while creating filesystem %s on device %s: %v", devices.filesystem, info.Name(), err)
|
|
| 604 | 604 |
} else {
|
| 605 |
- logrus.Infof("devmapper: Successfully created filesystem %s on device %s", devices.filesystem, info.Name())
|
|
| 605 |
+ logrus.WithField("storage-driver", "devicemapper").Infof("Successfully created filesystem %s on device %s", devices.filesystem, info.Name())
|
|
| 606 | 606 |
} |
| 607 | 607 |
}() |
| 608 | 608 |
|
| ... | ... |
@@ -668,7 +669,7 @@ func (devices *DeviceSet) cleanupDeletedDevices() error {
|
| 668 | 668 |
if !info.Deleted {
|
| 669 | 669 |
continue |
| 670 | 670 |
} |
| 671 |
- logrus.Debugf("devmapper: Found deleted device %s.", info.Hash)
|
|
| 671 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Found deleted device %s.", info.Hash)
|
|
| 672 | 672 |
deletedDevices = append(deletedDevices, info) |
| 673 | 673 |
} |
| 674 | 674 |
|
| ... | ... |
@@ -679,7 +680,7 @@ func (devices *DeviceSet) cleanupDeletedDevices() error {
|
| 679 | 679 |
for _, info := range deletedDevices {
|
| 680 | 680 |
// This will again try deferred deletion. |
| 681 | 681 |
if err := devices.DeleteDevice(info.Hash, false); err != nil {
|
| 682 |
- logrus.Warnf("devmapper: Deletion of device %s, device_id=%v failed:%v", info.Hash, info.DeviceID, err)
|
|
| 682 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("Deletion of device %s, device_id=%v failed:%v", info.Hash, info.DeviceID, err)
|
|
| 683 | 683 |
} |
| 684 | 684 |
} |
| 685 | 685 |
|
| ... | ... |
@@ -701,7 +702,7 @@ func (devices *DeviceSet) startDeviceDeletionWorker() {
|
| 701 | 701 |
return |
| 702 | 702 |
} |
| 703 | 703 |
|
| 704 |
- logrus.Debug("devmapper: Worker to cleanup deleted devices started")
|
|
| 704 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Worker to cleanup deleted devices started")
|
|
| 705 | 705 |
for range devices.deletionWorkerTicker.C {
|
| 706 | 706 |
devices.cleanupDeletedDevices() |
| 707 | 707 |
} |
| ... | ... |
@@ -797,8 +798,10 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*devInfo, error) {
|
| 797 | 797 |
return nil, err |
| 798 | 798 |
} |
| 799 | 799 |
|
| 800 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 801 |
+ |
|
| 800 | 802 |
if err := devices.openTransaction(hash, deviceID); err != nil {
|
| 801 |
- logrus.Debugf("devmapper: Error opening transaction hash = %s deviceID = %d", hash, deviceID)
|
|
| 803 |
+ logger.Debugf("Error opening transaction hash = %s deviceID = %d", hash, deviceID)
|
|
| 802 | 804 |
devices.markDeviceIDFree(deviceID) |
| 803 | 805 |
return nil, err |
| 804 | 806 |
} |
| ... | ... |
@@ -810,7 +813,7 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*devInfo, error) {
|
| 810 | 810 |
// happen. Now we have a mechanism to find |
| 811 | 811 |
// a free device ID. So something is not right. |
| 812 | 812 |
// Give a warning and continue. |
| 813 |
- logrus.Errorf("devmapper: Device ID %d exists in pool but it is supposed to be unused", deviceID)
|
|
| 813 |
+ logger.Errorf("Device ID %d exists in pool but it is supposed to be unused", deviceID)
|
|
| 814 | 814 |
deviceID, err = devices.getNextFreeDeviceID() |
| 815 | 815 |
if err != nil {
|
| 816 | 816 |
return nil, err |
| ... | ... |
@@ -819,14 +822,14 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*devInfo, error) {
|
| 819 | 819 |
devices.refreshTransaction(deviceID) |
| 820 | 820 |
continue |
| 821 | 821 |
} |
| 822 |
- logrus.Debugf("devmapper: Error creating device: %s", err)
|
|
| 822 |
+ logger.Debugf("Error creating device: %s", err)
|
|
| 823 | 823 |
devices.markDeviceIDFree(deviceID) |
| 824 | 824 |
return nil, err |
| 825 | 825 |
} |
| 826 | 826 |
break |
| 827 | 827 |
} |
| 828 | 828 |
|
| 829 |
- logrus.Debugf("devmapper: Registering device (id %v) with FS size %v", deviceID, devices.baseFsSize)
|
|
| 829 |
+ logger.Debugf("Registering device (id %v) with FS size %v", deviceID, devices.baseFsSize)
|
|
| 830 | 830 |
info, err := devices.registerDevice(deviceID, hash, devices.baseFsSize, devices.OpenTransactionID) |
| 831 | 831 |
if err != nil {
|
| 832 | 832 |
_ = devicemapper.DeleteDevice(devices.getPoolDevName(), deviceID) |
| ... | ... |
@@ -895,8 +898,10 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *devInf |
| 895 | 895 |
return err |
| 896 | 896 |
} |
| 897 | 897 |
|
| 898 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 899 |
+ |
|
| 898 | 900 |
if err := devices.openTransaction(hash, deviceID); err != nil {
|
| 899 |
- logrus.Debugf("devmapper: Error opening transaction hash = %s deviceID = %d", hash, deviceID)
|
|
| 901 |
+ logger.Debugf("Error opening transaction hash = %s deviceID = %d", hash, deviceID)
|
|
| 900 | 902 |
devices.markDeviceIDFree(deviceID) |
| 901 | 903 |
return err |
| 902 | 904 |
} |
| ... | ... |
@@ -908,7 +913,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *devInf |
| 908 | 908 |
// happen. Now we have a mechanism to find |
| 909 | 909 |
// a free device ID. So something is not right. |
| 910 | 910 |
// Give a warning and continue. |
| 911 |
- logrus.Errorf("devmapper: Device ID %d exists in pool but it is supposed to be unused", deviceID)
|
|
| 911 |
+ logger.Errorf("Device ID %d exists in pool but it is supposed to be unused", deviceID)
|
|
| 912 | 912 |
deviceID, err = devices.getNextFreeDeviceID() |
| 913 | 913 |
if err != nil {
|
| 914 | 914 |
return err |
| ... | ... |
@@ -917,7 +922,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *devInf |
| 917 | 917 |
devices.refreshTransaction(deviceID) |
| 918 | 918 |
continue |
| 919 | 919 |
} |
| 920 |
- logrus.Debugf("devmapper: Error creating snap device: %s", err)
|
|
| 920 |
+ logger.Debugf("Error creating snap device: %s", err)
|
|
| 921 | 921 |
devices.markDeviceIDFree(deviceID) |
| 922 | 922 |
return err |
| 923 | 923 |
} |
| ... | ... |
@@ -927,7 +932,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *devInf |
| 927 | 927 |
if _, err := devices.registerDevice(deviceID, hash, size, devices.OpenTransactionID); err != nil {
|
| 928 | 928 |
devicemapper.DeleteDevice(devices.getPoolDevName(), deviceID) |
| 929 | 929 |
devices.markDeviceIDFree(deviceID) |
| 930 |
- logrus.Debugf("devmapper: Error registering device: %s", err)
|
|
| 930 |
+ logger.Debugf("Error registering device: %s", err)
|
|
| 931 | 931 |
return err |
| 932 | 932 |
} |
| 933 | 933 |
|
| ... | ... |
@@ -942,20 +947,21 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *devInf |
| 942 | 942 |
|
| 943 | 943 |
func (devices *DeviceSet) loadMetadata(hash string) *devInfo {
|
| 944 | 944 |
info := &devInfo{Hash: hash, devices: devices}
|
| 945 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 945 | 946 |
|
| 946 | 947 |
jsonData, err := ioutil.ReadFile(devices.metadataFile(info)) |
| 947 | 948 |
if err != nil {
|
| 948 |
- logrus.Debugf("devmapper: Failed to read %s with err: %v", devices.metadataFile(info), err)
|
|
| 949 |
+ logger.Debugf("Failed to read %s with err: %v", devices.metadataFile(info), err)
|
|
| 949 | 950 |
return nil |
| 950 | 951 |
} |
| 951 | 952 |
|
| 952 | 953 |
if err := json.Unmarshal(jsonData, &info); err != nil {
|
| 953 |
- logrus.Debugf("devmapper: Failed to unmarshal devInfo from %s with err: %v", devices.metadataFile(info), err)
|
|
| 954 |
+ logger.Debugf("Failed to unmarshal devInfo from %s with err: %v", devices.metadataFile(info), err)
|
|
| 954 | 955 |
return nil |
| 955 | 956 |
} |
| 956 | 957 |
|
| 957 | 958 |
if info.DeviceID > maxDeviceID {
|
| 958 |
- logrus.Errorf("devmapper: Ignoring Invalid DeviceId=%d", info.DeviceID)
|
|
| 959 |
+ logger.Errorf("Ignoring Invalid DeviceId=%d", info.DeviceID)
|
|
| 959 | 960 |
return nil |
| 960 | 961 |
} |
| 961 | 962 |
|
| ... | ... |
@@ -970,7 +976,7 @@ func getDeviceUUID(device string) (string, error) {
|
| 970 | 970 |
|
| 971 | 971 |
uuid := strings.TrimSuffix(string(out), "\n") |
| 972 | 972 |
uuid = strings.TrimSpace(uuid) |
| 973 |
- logrus.Debugf("devmapper: UUID for device: %s is:%s", device, uuid)
|
|
| 973 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("UUID for device: %s is:%s", device, uuid)
|
|
| 974 | 974 |
return uuid, nil |
| 975 | 975 |
} |
| 976 | 976 |
|
| ... | ... |
@@ -1018,7 +1024,7 @@ func (devices *DeviceSet) verifyBaseDeviceUUIDFS(baseInfo *devInfo) error {
|
| 1018 | 1018 |
// file system of base image is not same, warn user that dm.fs |
| 1019 | 1019 |
// will be ignored. |
| 1020 | 1020 |
if devices.BaseDeviceFilesystem != devices.filesystem {
|
| 1021 |
- logrus.Warnf("devmapper: Base device already exists and has filesystem %s on it. User specified filesystem %s will be ignored.", devices.BaseDeviceFilesystem, devices.filesystem)
|
|
| 1021 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("Base device already exists and has filesystem %s on it. User specified filesystem %s will be ignored.", devices.BaseDeviceFilesystem, devices.filesystem)
|
|
| 1022 | 1022 |
devices.filesystem = devices.BaseDeviceFilesystem |
| 1023 | 1023 |
} |
| 1024 | 1024 |
return nil |
| ... | ... |
@@ -1048,7 +1054,7 @@ func (devices *DeviceSet) saveBaseDeviceUUID(baseInfo *devInfo) error {
|
| 1048 | 1048 |
} |
| 1049 | 1049 |
|
| 1050 | 1050 |
func (devices *DeviceSet) createBaseImage() error {
|
| 1051 |
- logrus.Debug("devmapper: Initializing base device-mapper thin volume")
|
|
| 1051 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Initializing base device-mapper thin volume")
|
|
| 1052 | 1052 |
|
| 1053 | 1053 |
// Create initial device |
| 1054 | 1054 |
info, err := devices.createRegisterDevice("")
|
| ... | ... |
@@ -1056,7 +1062,7 @@ func (devices *DeviceSet) createBaseImage() error {
|
| 1056 | 1056 |
return err |
| 1057 | 1057 |
} |
| 1058 | 1058 |
|
| 1059 |
- logrus.Debug("devmapper: Creating filesystem on base device-mapper thin volume")
|
|
| 1059 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Creating filesystem on base device-mapper thin volume")
|
|
| 1060 | 1060 |
|
| 1061 | 1061 |
if err := devices.activateDeviceIfNeeded(info, false); err != nil {
|
| 1062 | 1062 |
return err |
| ... | ... |
@@ -1082,7 +1088,7 @@ func (devices *DeviceSet) createBaseImage() error {
|
| 1082 | 1082 |
// Returns if thin pool device exists or not. If device exists, also makes |
| 1083 | 1083 |
// sure it is a thin pool device and not some other type of device. |
| 1084 | 1084 |
func (devices *DeviceSet) thinPoolExists(thinPoolDevice string) (bool, error) {
|
| 1085 |
- logrus.Debugf("devmapper: Checking for existence of the pool %s", thinPoolDevice)
|
|
| 1085 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Checking for existence of the pool %s", thinPoolDevice)
|
|
| 1086 | 1086 |
|
| 1087 | 1087 |
info, err := devicemapper.GetInfo(thinPoolDevice) |
| 1088 | 1088 |
if err != nil {
|
| ... | ... |
@@ -1229,7 +1235,7 @@ func (devices *DeviceSet) setupBaseImage() error {
|
| 1229 | 1229 |
return devices.checkGrowBaseDeviceFS(oldInfo) |
| 1230 | 1230 |
} |
| 1231 | 1231 |
|
| 1232 |
- logrus.Debug("devmapper: Removing uninitialized base image")
|
|
| 1232 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Removing uninitialized base image")
|
|
| 1233 | 1233 |
// If previous base device is in deferred delete state, |
| 1234 | 1234 |
// that needs to be cleaned up first. So don't try |
| 1235 | 1235 |
// deferred deletion. |
| ... | ... |
@@ -1374,24 +1380,26 @@ func (devices *DeviceSet) removeTransactionMetaData() error {
|
| 1374 | 1374 |
} |
| 1375 | 1375 |
|
| 1376 | 1376 |
func (devices *DeviceSet) rollbackTransaction() error {
|
| 1377 |
- logrus.Debugf("devmapper: Rolling back open transaction: TransactionID=%d hash=%s device_id=%d", devices.OpenTransactionID, devices.DeviceIDHash, devices.DeviceID)
|
|
| 1377 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 1378 |
+ |
|
| 1379 |
+ logger.Debugf("Rolling back open transaction: TransactionID=%d hash=%s device_id=%d", devices.OpenTransactionID, devices.DeviceIDHash, devices.DeviceID)
|
|
| 1378 | 1380 |
|
| 1379 | 1381 |
// A device id might have already been deleted before transaction |
| 1380 | 1382 |
// closed. In that case this call will fail. Just leave a message |
| 1381 | 1383 |
// in case of failure. |
| 1382 | 1384 |
if err := devicemapper.DeleteDevice(devices.getPoolDevName(), devices.DeviceID); err != nil {
|
| 1383 |
- logrus.Errorf("devmapper: Unable to delete device: %s", err)
|
|
| 1385 |
+ logger.Errorf("Unable to delete device: %s", err)
|
|
| 1384 | 1386 |
} |
| 1385 | 1387 |
|
| 1386 | 1388 |
dinfo := &devInfo{Hash: devices.DeviceIDHash}
|
| 1387 | 1389 |
if err := devices.removeMetadata(dinfo); err != nil {
|
| 1388 |
- logrus.Errorf("devmapper: Unable to remove metadata: %s", err)
|
|
| 1390 |
+ logger.Errorf("Unable to remove metadata: %s", err)
|
|
| 1389 | 1391 |
} else {
|
| 1390 | 1392 |
devices.markDeviceIDFree(devices.DeviceID) |
| 1391 | 1393 |
} |
| 1392 | 1394 |
|
| 1393 | 1395 |
if err := devices.removeTransactionMetaData(); err != nil {
|
| 1394 |
- logrus.Errorf("devmapper: Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
|
|
| 1396 |
+ logger.Errorf("Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
|
|
| 1395 | 1397 |
} |
| 1396 | 1398 |
|
| 1397 | 1399 |
return nil |
| ... | ... |
@@ -1411,7 +1419,7 @@ func (devices *DeviceSet) processPendingTransaction() error {
|
| 1411 | 1411 |
// If open transaction ID is less than pool transaction ID, something |
| 1412 | 1412 |
// is wrong. Bail out. |
| 1413 | 1413 |
if devices.OpenTransactionID < devices.TransactionID {
|
| 1414 |
- logrus.Errorf("devmapper: Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionID, devices.TransactionID)
|
|
| 1414 |
+ logrus.WithField("storage-driver", "devicemapper").Errorf("Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionID, devices.TransactionID)
|
|
| 1415 | 1415 |
return nil |
| 1416 | 1416 |
} |
| 1417 | 1417 |
|
| ... | ... |
@@ -1468,7 +1476,7 @@ func (devices *DeviceSet) refreshTransaction(DeviceID int) error {
|
| 1468 | 1468 |
|
| 1469 | 1469 |
func (devices *DeviceSet) closeTransaction() error {
|
| 1470 | 1470 |
if err := devices.updatePoolTransactionID(); err != nil {
|
| 1471 |
- logrus.Debug("devmapper: Failed to close Transaction")
|
|
| 1471 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Failed to close Transaction")
|
|
| 1472 | 1472 |
return err |
| 1473 | 1473 |
} |
| 1474 | 1474 |
return nil |
| ... | ... |
@@ -1477,7 +1485,7 @@ func (devices *DeviceSet) closeTransaction() error {
|
| 1477 | 1477 |
func determineDriverCapabilities(version string) error {
|
| 1478 | 1478 |
// Kernel driver version >= 4.27.0 support deferred removal |
| 1479 | 1479 |
|
| 1480 |
- logrus.Debugf("devicemapper: kernel dm driver version is %s", version)
|
|
| 1480 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("kernel dm driver version is %s", version)
|
|
| 1481 | 1481 |
|
| 1482 | 1482 |
versionSplit := strings.Split(version, ".") |
| 1483 | 1483 |
major, err := strconv.Atoi(versionSplit[0]) |
| ... | ... |
@@ -1523,7 +1531,7 @@ func getDeviceMajorMinor(file *os.File) (uint64, uint64, error) {
|
| 1523 | 1523 |
majorNum := major(dev) |
| 1524 | 1524 |
minorNum := minor(dev) |
| 1525 | 1525 |
|
| 1526 |
- logrus.Debugf("devmapper: Major:Minor for device: %s is:%v:%v", file.Name(), majorNum, minorNum)
|
|
| 1526 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Major:Minor for device: %s is:%v:%v", file.Name(), majorNum, minorNum)
|
|
| 1527 | 1527 |
return majorNum, minorNum, nil |
| 1528 | 1528 |
} |
| 1529 | 1529 |
|
| ... | ... |
@@ -1532,7 +1540,7 @@ func getDeviceMajorMinor(file *os.File) (uint64, uint64, error) {
|
| 1532 | 1532 |
func getLoopFileDeviceMajMin(filename string) (string, uint64, uint64, error) {
|
| 1533 | 1533 |
file, err := os.Open(filename) |
| 1534 | 1534 |
if err != nil {
|
| 1535 |
- logrus.Debugf("devmapper: Failed to open file %s", filename)
|
|
| 1535 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Failed to open file %s", filename)
|
|
| 1536 | 1536 |
return "", 0, 0, err |
| 1537 | 1537 |
} |
| 1538 | 1538 |
|
| ... | ... |
@@ -1563,7 +1571,7 @@ func (devices *DeviceSet) getThinPoolDataMetaMajMin() (uint64, uint64, uint64, u |
| 1563 | 1563 |
return 0, 0, 0, 0, err |
| 1564 | 1564 |
} |
| 1565 | 1565 |
|
| 1566 |
- logrus.Debugf("devmapper: poolDataMajMin=%s poolMetaMajMin=%s\n", poolDataMajMin, poolMetadataMajMin)
|
|
| 1566 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("poolDataMajMin=%s poolMetaMajMin=%s\n", poolDataMajMin, poolMetadataMajMin)
|
|
| 1567 | 1567 |
|
| 1568 | 1568 |
poolDataMajMinorSplit := strings.Split(poolDataMajMin, ":") |
| 1569 | 1569 |
poolDataMajor, err := strconv.ParseUint(poolDataMajMinorSplit[0], 10, 32) |
| ... | ... |
@@ -1643,7 +1651,7 @@ func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
|
| 1643 | 1643 |
if !devicemapper.LibraryDeferredRemovalSupport {
|
| 1644 | 1644 |
return fmt.Errorf("devmapper: Deferred removal can not be enabled as libdm does not support it")
|
| 1645 | 1645 |
} |
| 1646 |
- logrus.Debug("devmapper: Deferred removal support enabled.")
|
|
| 1646 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Deferred removal support enabled.")
|
|
| 1647 | 1647 |
devices.deferredRemove = true |
| 1648 | 1648 |
} |
| 1649 | 1649 |
|
| ... | ... |
@@ -1651,7 +1659,7 @@ func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
|
| 1651 | 1651 |
if !devices.deferredRemove {
|
| 1652 | 1652 |
return fmt.Errorf("devmapper: Deferred deletion can not be enabled as deferred removal is not enabled. Enable deferred removal using --storage-opt dm.use_deferred_removal=true parameter")
|
| 1653 | 1653 |
} |
| 1654 |
- logrus.Debug("devmapper: Deferred deletion support enabled.")
|
|
| 1654 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("Deferred deletion support enabled.")
|
|
| 1655 | 1655 |
devices.deferredDelete = true |
| 1656 | 1656 |
} |
| 1657 | 1657 |
return nil |
| ... | ... |
@@ -1662,12 +1670,14 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1662 | 1662 |
return err |
| 1663 | 1663 |
} |
| 1664 | 1664 |
|
| 1665 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 1666 |
+ |
|
| 1665 | 1667 |
// https://github.com/docker/docker/issues/4036 |
| 1666 | 1668 |
if supported := devicemapper.UdevSetSyncSupport(true); !supported {
|
| 1667 | 1669 |
if dockerversion.IAmStatic == "true" {
|
| 1668 |
- logrus.Error("devmapper: Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a dynamic binary to use devicemapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options")
|
|
| 1670 |
+ logger.Error("Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a dynamic binary to use devicemapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options")
|
|
| 1669 | 1671 |
} else {
|
| 1670 |
- logrus.Error("devmapper: Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a more recent version of libdevmapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options")
|
|
| 1672 |
+ logger.Error("Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a more recent version of libdevmapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options")
|
|
| 1671 | 1673 |
} |
| 1672 | 1674 |
|
| 1673 | 1675 |
if !devices.overrideUdevSyncCheck {
|
| ... | ... |
@@ -1702,7 +1712,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1702 | 1702 |
if !reflect.DeepEqual(prevSetupConfig, directLVMConfig{}) {
|
| 1703 | 1703 |
return errors.New("changing direct-lvm config is not supported")
|
| 1704 | 1704 |
} |
| 1705 |
- logrus.WithField("storage-driver", "devicemapper").WithField("direct-lvm-config", devices.lvmSetupConfig).Debugf("Setting up direct lvm mode")
|
|
| 1705 |
+ logger.WithField("direct-lvm-config", devices.lvmSetupConfig).Debugf("Setting up direct lvm mode")
|
|
| 1706 | 1706 |
if err := verifyBlockDevice(devices.lvmSetupConfig.Device, lvmSetupConfigForce); err != nil {
|
| 1707 | 1707 |
return err |
| 1708 | 1708 |
} |
| ... | ... |
@@ -1714,7 +1724,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1714 | 1714 |
} |
| 1715 | 1715 |
} |
| 1716 | 1716 |
devices.thinPoolDevice = "docker-thinpool" |
| 1717 |
- logrus.WithField("storage-driver", "devicemapper").Debugf("Setting dm.thinpooldev to %q", devices.thinPoolDevice)
|
|
| 1717 |
+ logger.Debugf("Setting dm.thinpooldev to %q", devices.thinPoolDevice)
|
|
| 1718 | 1718 |
} |
| 1719 | 1719 |
|
| 1720 | 1720 |
// Set the device prefix from the device id and inode of the docker root dir |
| ... | ... |
@@ -1729,7 +1739,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1729 | 1729 |
// - The target of this device is at major <maj> and minor <min> |
| 1730 | 1730 |
// - If <inode> is defined, use that file inside the device as a loopback image. Otherwise use the device itself. |
| 1731 | 1731 |
devices.devicePrefix = fmt.Sprintf("docker-%d:%d-%d", major(st.Dev), minor(st.Dev), st.Ino)
|
| 1732 |
- logrus.Debugf("devmapper: Generated prefix: %s", devices.devicePrefix)
|
|
| 1732 |
+ logger.Debugf("Generated prefix: %s", devices.devicePrefix)
|
|
| 1733 | 1733 |
|
| 1734 | 1734 |
// Check for the existence of the thin-pool device |
| 1735 | 1735 |
poolExists, err := devices.thinPoolExists(devices.getPoolName()) |
| ... | ... |
@@ -1749,7 +1759,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1749 | 1749 |
|
| 1750 | 1750 |
// If the pool doesn't exist, create it |
| 1751 | 1751 |
if !poolExists && devices.thinPoolDevice == "" {
|
| 1752 |
- logrus.Debug("devmapper: Pool doesn't exist. Creating it.")
|
|
| 1752 |
+ logger.Debug("Pool doesn't exist. Creating it.")
|
|
| 1753 | 1753 |
|
| 1754 | 1754 |
var ( |
| 1755 | 1755 |
dataFile *os.File |
| ... | ... |
@@ -1771,7 +1781,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1771 | 1771 |
|
| 1772 | 1772 |
data, err := devices.ensureImage("data", devices.dataLoopbackSize)
|
| 1773 | 1773 |
if err != nil {
|
| 1774 |
- logrus.Debugf("devmapper: Error device ensureImage (data): %s", err)
|
|
| 1774 |
+ logger.Debugf("Error device ensureImage (data): %s", err)
|
|
| 1775 | 1775 |
return err |
| 1776 | 1776 |
} |
| 1777 | 1777 |
|
| ... | ... |
@@ -1804,7 +1814,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1804 | 1804 |
|
| 1805 | 1805 |
metadata, err := devices.ensureImage("metadata", devices.metaDataLoopbackSize)
|
| 1806 | 1806 |
if err != nil {
|
| 1807 |
- logrus.Debugf("devmapper: Error device ensureImage (metadata): %s", err)
|
|
| 1807 |
+ logger.Debugf("Error device ensureImage (metadata): %s", err)
|
|
| 1808 | 1808 |
return err |
| 1809 | 1809 |
} |
| 1810 | 1810 |
|
| ... | ... |
@@ -1829,7 +1839,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1829 | 1829 |
if retErr != nil {
|
| 1830 | 1830 |
err = devices.deactivatePool() |
| 1831 | 1831 |
if err != nil {
|
| 1832 |
- logrus.Warnf("devmapper: Failed to deactivatePool: %v", err)
|
|
| 1832 |
+ logger.Warnf("Failed to deactivatePool: %v", err)
|
|
| 1833 | 1833 |
} |
| 1834 | 1834 |
} |
| 1835 | 1835 |
}() |
| ... | ... |
@@ -1841,7 +1851,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1841 | 1841 |
// pool, like is it using loop devices. |
| 1842 | 1842 |
if poolExists && devices.thinPoolDevice == "" {
|
| 1843 | 1843 |
if err := devices.loadThinPoolLoopBackInfo(); err != nil {
|
| 1844 |
- logrus.Debugf("devmapper: Failed to load thin pool loopback device information:%v", err)
|
|
| 1844 |
+ logger.Debugf("Failed to load thin pool loopback device information:%v", err)
|
|
| 1845 | 1845 |
return err |
| 1846 | 1846 |
} |
| 1847 | 1847 |
} |
| ... | ... |
@@ -1856,7 +1866,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1856 | 1856 |
|
| 1857 | 1857 |
if devices.thinPoolDevice == "" {
|
| 1858 | 1858 |
if devices.metadataLoopFile != "" || devices.dataLoopFile != "" {
|
| 1859 |
- logrus.Warn("devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to dm.thinpooldev section.")
|
|
| 1859 |
+ logger.Warn("Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to dm.thinpooldev section.")
|
|
| 1860 | 1860 |
} |
| 1861 | 1861 |
} |
| 1862 | 1862 |
|
| ... | ... |
@@ -1869,7 +1879,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1869 | 1869 |
// Setup the base image |
| 1870 | 1870 |
if doInit {
|
| 1871 | 1871 |
if err := devices.setupBaseImage(); err != nil {
|
| 1872 |
- logrus.Debugf("devmapper: Error device setupBaseImage: %s", err)
|
|
| 1872 |
+ logger.Debugf("Error device setupBaseImage: %s", err)
|
|
| 1873 | 1873 |
return err |
| 1874 | 1874 |
} |
| 1875 | 1875 |
} |
| ... | ... |
@@ -1879,8 +1889,8 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
| 1879 | 1879 |
|
| 1880 | 1880 |
// AddDevice adds a device and registers in the hash. |
| 1881 | 1881 |
func (devices *DeviceSet) AddDevice(hash, baseHash string, storageOpt map[string]string) error {
|
| 1882 |
- logrus.Debugf("devmapper: AddDevice START(hash=%s basehash=%s)", hash, baseHash)
|
|
| 1883 |
- defer logrus.Debugf("devmapper: AddDevice END(hash=%s basehash=%s)", hash, baseHash)
|
|
| 1882 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("AddDevice START(hash=%s basehash=%s)", hash, baseHash)
|
|
| 1883 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("AddDevice END(hash=%s basehash=%s)", hash, baseHash)
|
|
| 1884 | 1884 |
|
| 1885 | 1885 |
// If a deleted device exists, return error. |
| 1886 | 1886 |
baseInfo, err := devices.lookupDeviceWithLock(baseHash) |
| ... | ... |
@@ -1962,7 +1972,7 @@ func (devices *DeviceSet) markForDeferredDeletion(info *devInfo) error {
|
| 1962 | 1962 |
return nil |
| 1963 | 1963 |
} |
| 1964 | 1964 |
|
| 1965 |
- logrus.Debugf("devmapper: Marking device %s for deferred deletion.", info.Hash)
|
|
| 1965 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Marking device %s for deferred deletion.", info.Hash)
|
|
| 1966 | 1966 |
|
| 1967 | 1967 |
info.Deleted = true |
| 1968 | 1968 |
|
| ... | ... |
@@ -1979,7 +1989,7 @@ func (devices *DeviceSet) markForDeferredDeletion(info *devInfo) error {
|
| 1979 | 1979 |
// Should be called with devices.Lock() held. |
| 1980 | 1980 |
func (devices *DeviceSet) deleteTransaction(info *devInfo, syncDelete bool) error {
|
| 1981 | 1981 |
if err := devices.openTransaction(info.Hash, info.DeviceID); err != nil {
|
| 1982 |
- logrus.Debugf("devmapper: Error opening transaction hash = %s deviceId = %d", "", info.DeviceID)
|
|
| 1982 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Error opening transaction hash = %s deviceId = %d", "", info.DeviceID)
|
|
| 1983 | 1983 |
return err |
| 1984 | 1984 |
} |
| 1985 | 1985 |
|
| ... | ... |
@@ -1991,7 +2001,7 @@ func (devices *DeviceSet) deleteTransaction(info *devInfo, syncDelete bool) erro |
| 1991 | 1991 |
// deletion is not enabled, we return an error. If error is |
| 1992 | 1992 |
// something other then EBUSY, return an error. |
| 1993 | 1993 |
if syncDelete || !devices.deferredDelete || err != devicemapper.ErrBusy {
|
| 1994 |
- logrus.Debugf("devmapper: Error deleting device: %s", err)
|
|
| 1994 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Error deleting device: %s", err)
|
|
| 1995 | 1995 |
return err |
| 1996 | 1996 |
} |
| 1997 | 1997 |
} |
| ... | ... |
@@ -2018,8 +2028,9 @@ func (devices *DeviceSet) deleteTransaction(info *devInfo, syncDelete bool) erro |
| 2018 | 2018 |
|
| 2019 | 2019 |
// Issue discard only if device open count is zero. |
| 2020 | 2020 |
func (devices *DeviceSet) issueDiscard(info *devInfo) error {
|
| 2021 |
- logrus.Debugf("devmapper: issueDiscard START(device: %s).", info.Hash)
|
|
| 2022 |
- defer logrus.Debugf("devmapper: issueDiscard END(device: %s).", info.Hash)
|
|
| 2021 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 2022 |
+ logger.Debugf("issueDiscard START(device: %s).", info.Hash)
|
|
| 2023 |
+ defer logger.Debugf("issueDiscard END(device: %s).", info.Hash)
|
|
| 2023 | 2024 |
// This is a workaround for the kernel not discarding block so |
| 2024 | 2025 |
// on the thin pool when we remove a thinp device, so we do it |
| 2025 | 2026 |
// manually. |
| ... | ... |
@@ -2035,12 +2046,12 @@ func (devices *DeviceSet) issueDiscard(info *devInfo) error {
|
| 2035 | 2035 |
} |
| 2036 | 2036 |
|
| 2037 | 2037 |
if devinfo.OpenCount != 0 {
|
| 2038 |
- logrus.Debugf("devmapper: Device: %s is in use. OpenCount=%d. Not issuing discards.", info.Hash, devinfo.OpenCount)
|
|
| 2038 |
+ logger.Debugf("Device: %s is in use. OpenCount=%d. Not issuing discards.", info.Hash, devinfo.OpenCount)
|
|
| 2039 | 2039 |
return nil |
| 2040 | 2040 |
} |
| 2041 | 2041 |
|
| 2042 | 2042 |
if err := devicemapper.BlockDeviceDiscard(info.DevName()); err != nil {
|
| 2043 |
- logrus.Debugf("devmapper: Error discarding block on device: %s (ignoring)", err)
|
|
| 2043 |
+ logger.Debugf("Error discarding block on device: %s (ignoring)", err)
|
|
| 2044 | 2044 |
} |
| 2045 | 2045 |
return nil |
| 2046 | 2046 |
} |
| ... | ... |
@@ -2062,7 +2073,7 @@ func (devices *DeviceSet) deleteDevice(info *devInfo, syncDelete bool) error {
|
| 2062 | 2062 |
} |
| 2063 | 2063 |
|
| 2064 | 2064 |
if err := devices.deactivateDeviceMode(info, deferredRemove); err != nil {
|
| 2065 |
- logrus.Debugf("devmapper: Error deactivating device: %s", err)
|
|
| 2065 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("Error deactivating device: %s", err)
|
|
| 2066 | 2066 |
return err |
| 2067 | 2067 |
} |
| 2068 | 2068 |
|
| ... | ... |
@@ -2073,8 +2084,8 @@ func (devices *DeviceSet) deleteDevice(info *devInfo, syncDelete bool) error {
|
| 2073 | 2073 |
// removal. If one wants to override that and want DeleteDevice() to fail if |
| 2074 | 2074 |
// device was busy and could not be deleted, set syncDelete=true. |
| 2075 | 2075 |
func (devices *DeviceSet) DeleteDevice(hash string, syncDelete bool) error {
|
| 2076 |
- logrus.Debugf("devmapper: DeleteDevice START(hash=%v syncDelete=%v)", hash, syncDelete)
|
|
| 2077 |
- defer logrus.Debugf("devmapper: DeleteDevice END(hash=%v syncDelete=%v)", hash, syncDelete)
|
|
| 2076 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("DeleteDevice START(hash=%v syncDelete=%v)", hash, syncDelete)
|
|
| 2077 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("DeleteDevice END(hash=%v syncDelete=%v)", hash, syncDelete)
|
|
| 2078 | 2078 |
info, err := devices.lookupDeviceWithLock(hash) |
| 2079 | 2079 |
if err != nil {
|
| 2080 | 2080 |
return err |
| ... | ... |
@@ -2090,8 +2101,8 @@ func (devices *DeviceSet) DeleteDevice(hash string, syncDelete bool) error {
|
| 2090 | 2090 |
} |
| 2091 | 2091 |
|
| 2092 | 2092 |
func (devices *DeviceSet) deactivatePool() error {
|
| 2093 |
- logrus.Debug("devmapper: deactivatePool() START")
|
|
| 2094 |
- defer logrus.Debug("devmapper: deactivatePool() END")
|
|
| 2093 |
+ logrus.WithField("storage-driver", "devicemapper").Debug("deactivatePool() START")
|
|
| 2094 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debug("deactivatePool() END")
|
|
| 2095 | 2095 |
devname := devices.getPoolDevName() |
| 2096 | 2096 |
|
| 2097 | 2097 |
devinfo, err := devicemapper.GetInfo(devname) |
| ... | ... |
@@ -2107,7 +2118,7 @@ func (devices *DeviceSet) deactivatePool() error {
|
| 2107 | 2107 |
} |
| 2108 | 2108 |
|
| 2109 | 2109 |
if d, err := devicemapper.GetDeps(devname); err == nil {
|
| 2110 |
- logrus.Warnf("devmapper: device %s still has %d active dependents", devname, d.Count)
|
|
| 2110 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("device %s still has %d active dependents", devname, d.Count)
|
|
| 2111 | 2111 |
} |
| 2112 | 2112 |
|
| 2113 | 2113 |
return nil |
| ... | ... |
@@ -2119,8 +2130,8 @@ func (devices *DeviceSet) deactivateDevice(info *devInfo) error {
|
| 2119 | 2119 |
|
| 2120 | 2120 |
func (devices *DeviceSet) deactivateDeviceMode(info *devInfo, deferredRemove bool) error {
|
| 2121 | 2121 |
var err error |
| 2122 |
- logrus.Debugf("devmapper: deactivateDevice START(%s)", info.Hash)
|
|
| 2123 |
- defer logrus.Debugf("devmapper: deactivateDevice END(%s)", info.Hash)
|
|
| 2122 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("deactivateDevice START(%s)", info.Hash)
|
|
| 2123 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("deactivateDevice END(%s)", info.Hash)
|
|
| 2124 | 2124 |
|
| 2125 | 2125 |
devinfo, err := devicemapper.GetInfo(info.Name()) |
| 2126 | 2126 |
if err != nil {
|
| ... | ... |
@@ -2150,8 +2161,8 @@ func (devices *DeviceSet) deactivateDeviceMode(info *devInfo, deferredRemove boo |
| 2150 | 2150 |
func (devices *DeviceSet) removeDevice(devname string) error {
|
| 2151 | 2151 |
var err error |
| 2152 | 2152 |
|
| 2153 |
- logrus.Debugf("devmapper: removeDevice START(%s)", devname)
|
|
| 2154 |
- defer logrus.Debugf("devmapper: removeDevice END(%s)", devname)
|
|
| 2153 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("removeDevice START(%s)", devname)
|
|
| 2154 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("removeDevice END(%s)", devname)
|
|
| 2155 | 2155 |
|
| 2156 | 2156 |
for i := 0; i < 200; i++ {
|
| 2157 | 2157 |
err = devicemapper.RemoveDevice(devname) |
| ... | ... |
@@ -2177,8 +2188,8 @@ func (devices *DeviceSet) cancelDeferredRemovalIfNeeded(info *devInfo) error {
|
| 2177 | 2177 |
return nil |
| 2178 | 2178 |
} |
| 2179 | 2179 |
|
| 2180 |
- logrus.Debugf("devmapper: cancelDeferredRemovalIfNeeded START(%s)", info.Name())
|
|
| 2181 |
- defer logrus.Debugf("devmapper: cancelDeferredRemovalIfNeeded END(%s)", info.Name())
|
|
| 2180 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("cancelDeferredRemovalIfNeeded START(%s)", info.Name())
|
|
| 2181 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("cancelDeferredRemovalIfNeeded END(%s)", info.Name())
|
|
| 2182 | 2182 |
|
| 2183 | 2183 |
devinfo, err := devicemapper.GetInfoWithDeferred(info.Name()) |
| 2184 | 2184 |
if err != nil {
|
| ... | ... |
@@ -2200,8 +2211,8 @@ func (devices *DeviceSet) cancelDeferredRemovalIfNeeded(info *devInfo) error {
|
| 2200 | 2200 |
} |
| 2201 | 2201 |
|
| 2202 | 2202 |
func (devices *DeviceSet) cancelDeferredRemoval(info *devInfo) error {
|
| 2203 |
- logrus.Debugf("devmapper: cancelDeferredRemoval START(%s)", info.Name())
|
|
| 2204 |
- defer logrus.Debugf("devmapper: cancelDeferredRemoval END(%s)", info.Name())
|
|
| 2203 |
+ logrus.WithField("storage-driver", "devicemapper").Debugf("cancelDeferredRemoval START(%s)", info.Name())
|
|
| 2204 |
+ defer logrus.WithField("storage-driver", "devicemapper").Debugf("cancelDeferredRemoval END(%s)", info.Name())
|
|
| 2205 | 2205 |
|
| 2206 | 2206 |
var err error |
| 2207 | 2207 |
|
| ... | ... |
@@ -2224,9 +2235,11 @@ func (devices *DeviceSet) cancelDeferredRemoval(info *devInfo) error {
|
| 2224 | 2224 |
} |
| 2225 | 2225 |
|
| 2226 | 2226 |
func (devices *DeviceSet) unmountAndDeactivateAll(dir string) {
|
| 2227 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 2228 |
+ |
|
| 2227 | 2229 |
files, err := ioutil.ReadDir(dir) |
| 2228 | 2230 |
if err != nil {
|
| 2229 |
- logrus.Warnf("devmapper: unmountAndDeactivate: %s", err)
|
|
| 2231 |
+ logger.Warnf("unmountAndDeactivate: %s", err)
|
|
| 2230 | 2232 |
return |
| 2231 | 2233 |
} |
| 2232 | 2234 |
|
| ... | ... |
@@ -2242,14 +2255,14 @@ func (devices *DeviceSet) unmountAndDeactivateAll(dir string) {
|
| 2242 | 2242 |
// container. This means it'll go away from the global scope directly, |
| 2243 | 2243 |
// and the device will be released when that container dies. |
| 2244 | 2244 |
if err := unix.Unmount(fullname, unix.MNT_DETACH); err != nil && err != unix.EINVAL {
|
| 2245 |
- logrus.Warnf("devmapper: Shutdown unmounting %s, error: %s", fullname, err)
|
|
| 2245 |
+ logger.Warnf("Shutdown unmounting %s, error: %s", fullname, err)
|
|
| 2246 | 2246 |
} |
| 2247 | 2247 |
|
| 2248 | 2248 |
if devInfo, err := devices.lookupDevice(name); err != nil {
|
| 2249 |
- logrus.Debugf("devmapper: Shutdown lookup device %s, error: %s", name, err)
|
|
| 2249 |
+ logger.Debugf("Shutdown lookup device %s, error: %s", name, err)
|
|
| 2250 | 2250 |
} else {
|
| 2251 | 2251 |
if err := devices.deactivateDevice(devInfo); err != nil {
|
| 2252 |
- logrus.Debugf("devmapper: Shutdown deactivate %s, error: %s", devInfo.Hash, err)
|
|
| 2252 |
+ logger.Debugf("Shutdown deactivate %s, error: %s", devInfo.Hash, err)
|
|
| 2253 | 2253 |
} |
| 2254 | 2254 |
} |
| 2255 | 2255 |
} |
| ... | ... |
@@ -2257,9 +2270,11 @@ func (devices *DeviceSet) unmountAndDeactivateAll(dir string) {
|
| 2257 | 2257 |
|
| 2258 | 2258 |
// Shutdown shuts down the device by unmounting the root. |
| 2259 | 2259 |
func (devices *DeviceSet) Shutdown(home string) error {
|
| 2260 |
- logrus.Debugf("devmapper: [deviceset %s] Shutdown()", devices.devicePrefix)
|
|
| 2261 |
- logrus.Debugf("devmapper: Shutting down DeviceSet: %s", devices.root)
|
|
| 2262 |
- defer logrus.Debugf("devmapper: [deviceset %s] Shutdown() END", devices.devicePrefix)
|
|
| 2260 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 2261 |
+ |
|
| 2262 |
+ logger.Debugf("[deviceset %s] Shutdown()", devices.devicePrefix)
|
|
| 2263 |
+ logger.Debugf("Shutting down DeviceSet: %s", devices.root)
|
|
| 2264 |
+ defer logger.Debugf("[deviceset %s] Shutdown() END", devices.devicePrefix)
|
|
| 2263 | 2265 |
|
| 2264 | 2266 |
// Stop deletion worker. This should start delivering new events to |
| 2265 | 2267 |
// ticker channel. That means no new instance of cleanupDeletedDevice() |
| ... | ... |
@@ -2284,7 +2299,7 @@ func (devices *DeviceSet) Shutdown(home string) error {
|
| 2284 | 2284 |
info.lock.Lock() |
| 2285 | 2285 |
devices.Lock() |
| 2286 | 2286 |
if err := devices.deactivateDevice(info); err != nil {
|
| 2287 |
- logrus.Debugf("devmapper: Shutdown deactivate base , error: %s", err)
|
|
| 2287 |
+ logger.Debugf("Shutdown deactivate base , error: %s", err)
|
|
| 2288 | 2288 |
} |
| 2289 | 2289 |
devices.Unlock() |
| 2290 | 2290 |
info.lock.Unlock() |
| ... | ... |
@@ -2293,7 +2308,7 @@ func (devices *DeviceSet) Shutdown(home string) error {
|
| 2293 | 2293 |
devices.Lock() |
| 2294 | 2294 |
if devices.thinPoolDevice == "" {
|
| 2295 | 2295 |
if err := devices.deactivatePool(); err != nil {
|
| 2296 |
- logrus.Debugf("devmapper: Shutdown deactivate pool , error: %s", err)
|
|
| 2296 |
+ logger.Debugf("Shutdown deactivate pool , error: %s", err)
|
|
| 2297 | 2297 |
} |
| 2298 | 2298 |
} |
| 2299 | 2299 |
devices.Unlock() |
| ... | ... |
@@ -2382,8 +2397,10 @@ func (devices *DeviceSet) MountDevice(hash, path, mountLabel string) error {
|
| 2382 | 2382 |
|
| 2383 | 2383 |
// UnmountDevice unmounts the device and removes it from hash. |
| 2384 | 2384 |
func (devices *DeviceSet) UnmountDevice(hash, mountPath string) error {
|
| 2385 |
- logrus.Debugf("devmapper: UnmountDevice START(hash=%s)", hash)
|
|
| 2386 |
- defer logrus.Debugf("devmapper: UnmountDevice END(hash=%s)", hash)
|
|
| 2385 |
+ logger := logrus.WithField("storage-driver", "devicemapper")
|
|
| 2386 |
+ |
|
| 2387 |
+ logger.Debugf("UnmountDevice START(hash=%s)", hash)
|
|
| 2388 |
+ defer logger.Debugf("UnmountDevice END(hash=%s)", hash)
|
|
| 2387 | 2389 |
|
| 2388 | 2390 |
info, err := devices.lookupDeviceWithLock(hash) |
| 2389 | 2391 |
if err != nil {
|
| ... | ... |
@@ -2396,11 +2413,11 @@ func (devices *DeviceSet) UnmountDevice(hash, mountPath string) error {
|
| 2396 | 2396 |
devices.Lock() |
| 2397 | 2397 |
defer devices.Unlock() |
| 2398 | 2398 |
|
| 2399 |
- logrus.Debugf("devmapper: Unmount(%s)", mountPath)
|
|
| 2399 |
+ logger.Debugf("Unmount(%s)", mountPath)
|
|
| 2400 | 2400 |
if err := unix.Unmount(mountPath, unix.MNT_DETACH); err != nil {
|
| 2401 | 2401 |
return err |
| 2402 | 2402 |
} |
| 2403 |
- logrus.Debug("devmapper: Unmount done")
|
|
| 2403 |
+ logger.Debug("Unmount done")
|
|
| 2404 | 2404 |
|
| 2405 | 2405 |
// Remove the mountpoint here. Removing the mountpoint (in newer kernels) |
| 2406 | 2406 |
// will cause all other instances of this mount in other mount namespaces |
| ... | ... |
@@ -2411,7 +2428,7 @@ func (devices *DeviceSet) UnmountDevice(hash, mountPath string) error {
|
| 2411 | 2411 |
// older kernels which don't have |
| 2412 | 2412 |
// torvalds/linux@8ed936b5671bfb33d89bc60bdcc7cf0470ba52fe applied. |
| 2413 | 2413 |
if err := os.Remove(mountPath); err != nil {
|
| 2414 |
- logrus.Debugf("devmapper: error doing a remove on unmounted device %s: %v", mountPath, err)
|
|
| 2414 |
+ logger.Debugf("error doing a remove on unmounted device %s: %v", mountPath, err)
|
|
| 2415 | 2415 |
} |
| 2416 | 2416 |
|
| 2417 | 2417 |
return devices.deactivateDevice(info) |
| ... | ... |
@@ -2508,7 +2525,7 @@ func (devices *DeviceSet) MetadataDevicePath() string {
|
| 2508 | 2508 |
func (devices *DeviceSet) getUnderlyingAvailableSpace(loopFile string) (uint64, error) {
|
| 2509 | 2509 |
buf := new(unix.Statfs_t) |
| 2510 | 2510 |
if err := unix.Statfs(loopFile, buf); err != nil {
|
| 2511 |
- logrus.Warnf("devmapper: Couldn't stat loopfile filesystem %v: %v", loopFile, err)
|
|
| 2511 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("Couldn't stat loopfile filesystem %v: %v", loopFile, err)
|
|
| 2512 | 2512 |
return 0, err |
| 2513 | 2513 |
} |
| 2514 | 2514 |
return buf.Bfree * uint64(buf.Bsize), nil |
| ... | ... |
@@ -2518,7 +2535,7 @@ func (devices *DeviceSet) isRealFile(loopFile string) (bool, error) {
|
| 2518 | 2518 |
if loopFile != "" {
|
| 2519 | 2519 |
fi, err := os.Stat(loopFile) |
| 2520 | 2520 |
if err != nil {
|
| 2521 |
- logrus.Warnf("devmapper: Couldn't stat loopfile %v: %v", loopFile, err)
|
|
| 2521 |
+ logrus.WithField("storage-driver", "devicemapper").Warnf("Couldn't stat loopfile %v: %v", loopFile, err)
|
|
| 2522 | 2522 |
return false, err |
| 2523 | 2523 |
} |
| 2524 | 2524 |
return fi.Mode().IsRegular(), nil |
| ... | ... |
@@ -246,7 +246,7 @@ func (d *Driver) Put(id string) error {
|
| 246 | 246 |
|
| 247 | 247 |
err := d.DeviceSet.UnmountDevice(id, mp) |
| 248 | 248 |
if err != nil {
|
| 249 |
- logrus.Errorf("devmapper: Error unmounting device %s: %v", id, err)
|
|
| 249 |
+ logrus.WithField("storage-driver", "devicemapper").Errorf("Error unmounting device %s: %v", id, err)
|
|
| 250 | 250 |
} |
| 251 | 251 |
|
| 252 | 252 |
return err |
| ... | ... |
@@ -139,7 +139,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 139 | 139 |
|
| 140 | 140 |
switch fsMagic {
|
| 141 | 141 |
case graphdriver.FsMagicAufs, graphdriver.FsMagicBtrfs, graphdriver.FsMagicEcryptfs, graphdriver.FsMagicNfsFs, graphdriver.FsMagicOverlay, graphdriver.FsMagicZfs: |
| 142 |
- logrus.Errorf("'overlay' is not supported over %s", backingFs)
|
|
| 142 |
+ logrus.WithField("storage-driver", "overlay").Errorf("'overlay' is not supported over %s", backingFs)
|
|
| 143 | 143 |
return nil, graphdriver.ErrIncompatibleFS |
| 144 | 144 |
} |
| 145 | 145 |
|
| ... | ... |
@@ -152,7 +152,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 152 | 152 |
return nil, overlayutils.ErrDTypeNotSupported("overlay", backingFs)
|
| 153 | 153 |
} |
| 154 | 154 |
// allow running without d_type only for existing setups (#27443) |
| 155 |
- logrus.Warn(overlayutils.ErrDTypeNotSupported("overlay", backingFs))
|
|
| 155 |
+ logrus.WithField("storage-driver", "overlay").Warn(overlayutils.ErrDTypeNotSupported("overlay", backingFs))
|
|
| 156 | 156 |
} |
| 157 | 157 |
|
| 158 | 158 |
rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps) |
| ... | ... |
@@ -193,7 +193,7 @@ func supportsOverlay() error {
|
| 193 | 193 |
return nil |
| 194 | 194 |
} |
| 195 | 195 |
} |
| 196 |
- logrus.Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
|
|
| 196 |
+ logrus.WithField("storage-driver", "overlay").Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
|
|
| 197 | 197 |
return graphdriver.ErrNotSupported |
| 198 | 198 |
} |
| 199 | 199 |
|
| ... | ... |
@@ -369,11 +369,11 @@ func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err erro |
| 369 | 369 |
if err != nil {
|
| 370 | 370 |
if c := d.ctr.Decrement(mergedDir); c <= 0 {
|
| 371 | 371 |
if mntErr := unix.Unmount(mergedDir, 0); mntErr != nil {
|
| 372 |
- logrus.Debugf("Failed to unmount %s: %v: %v", id, mntErr, err)
|
|
| 372 |
+ logrus.WithField("storage-driver", "overlay").Debugf("Failed to unmount %s: %v: %v", id, mntErr, err)
|
|
| 373 | 373 |
} |
| 374 | 374 |
// Cleanup the created merged directory; see the comment in Put's rmdir |
| 375 | 375 |
if rmErr := unix.Rmdir(mergedDir); rmErr != nil && !os.IsNotExist(rmErr) {
|
| 376 |
- logrus.Warnf("Failed to remove %s: %v: %v", id, rmErr, err)
|
|
| 376 |
+ logrus.WithField("storage-driver", "overlay").Warnf("Failed to remove %s: %v: %v", id, rmErr, err)
|
|
| 377 | 377 |
} |
| 378 | 378 |
} |
| 379 | 379 |
} |
| ... | ... |
@@ -417,11 +417,12 @@ func (d *Driver) Put(id string) error {
|
| 417 | 417 |
return nil |
| 418 | 418 |
} |
| 419 | 419 |
mountpoint := path.Join(d.dir(id), "merged") |
| 420 |
+ logger := logrus.WithField("storage-driver", "overlay")
|
|
| 420 | 421 |
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
| 421 | 422 |
return nil |
| 422 | 423 |
} |
| 423 | 424 |
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
| 424 |
- logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
|
|
| 425 |
+ logger.Debugf("Failed to unmount %s overlay: %v", id, err)
|
|
| 425 | 426 |
} |
| 426 | 427 |
|
| 427 | 428 |
// Remove the mountpoint here. Removing the mountpoint (in newer kernels) |
| ... | ... |
@@ -432,7 +433,7 @@ func (d *Driver) Put(id string) error {
|
| 432 | 432 |
// fail on older kernels which don't have |
| 433 | 433 |
// torvalds/linux@8ed936b5671bfb33d89bc60bdcc7cf0470ba52fe applied. |
| 434 | 434 |
if err := unix.Rmdir(mountpoint); err != nil {
|
| 435 |
- logrus.Debugf("Failed to remove %s overlay: %v", id, err)
|
|
| 435 |
+ logger.Debugf("Failed to remove %s overlay: %v", id, err)
|
|
| 436 | 436 |
} |
| 437 | 437 |
return nil |
| 438 | 438 |
} |
| ... | ... |
@@ -27,7 +27,7 @@ func doesSupportNativeDiff(d string) error {
|
| 27 | 27 |
} |
| 28 | 28 |
defer func() {
|
| 29 | 29 |
if err := os.RemoveAll(td); err != nil {
|
| 30 |
- logrus.Warnf("Failed to remove check directory %v: %v", td, err)
|
|
| 30 |
+ logrus.WithField("storage-driver", "overlay2").Warnf("Failed to remove check directory %v: %v", td, err)
|
|
| 31 | 31 |
} |
| 32 | 32 |
}() |
| 33 | 33 |
|
| ... | ... |
@@ -62,7 +62,7 @@ func doesSupportNativeDiff(d string) error {
|
| 62 | 62 |
} |
| 63 | 63 |
defer func() {
|
| 64 | 64 |
if err := unix.Unmount(filepath.Join(td, "merged"), 0); err != nil {
|
| 65 |
- logrus.Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err)
|
|
| 65 |
+ logrus.WithField("storage-driver", "overlay2").Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err)
|
|
| 66 | 66 |
} |
| 67 | 67 |
}() |
| 68 | 68 |
|
| ... | ... |
@@ -113,7 +113,7 @@ func supportsMultipleLowerDir(d string) error {
|
| 113 | 113 |
} |
| 114 | 114 |
defer func() {
|
| 115 | 115 |
if err := os.RemoveAll(td); err != nil {
|
| 116 |
- logrus.Warnf("Failed to remove check directory %v: %v", td, err)
|
|
| 116 |
+ logrus.WithField("storage-driver", "overlay2").Warnf("Failed to remove check directory %v: %v", td, err)
|
|
| 117 | 117 |
} |
| 118 | 118 |
}() |
| 119 | 119 |
|
| ... | ... |
@@ -128,7 +128,7 @@ func supportsMultipleLowerDir(d string) error {
|
| 128 | 128 |
return errors.Wrap(err, "failed to mount overlay") |
| 129 | 129 |
} |
| 130 | 130 |
if err := unix.Unmount(filepath.Join(td, "merged"), 0); err != nil {
|
| 131 |
- logrus.Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err)
|
|
| 131 |
+ logrus.WithField("storage-driver", "overlay2").Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err)
|
|
| 132 | 132 |
} |
| 133 | 133 |
return nil |
| 134 | 134 |
} |
| ... | ... |
@@ -154,28 +154,30 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 154 | 154 |
backingFs = fsName |
| 155 | 155 |
} |
| 156 | 156 |
|
| 157 |
+ logger := logrus.WithField("storage-driver", "overlay2")
|
|
| 158 |
+ |
|
| 157 | 159 |
switch fsMagic {
|
| 158 | 160 |
case graphdriver.FsMagicAufs, graphdriver.FsMagicEcryptfs, graphdriver.FsMagicNfsFs, graphdriver.FsMagicOverlay, graphdriver.FsMagicZfs: |
| 159 |
- logrus.Errorf("'overlay2' is not supported over %s", backingFs)
|
|
| 161 |
+ logger.Errorf("'overlay2' is not supported over %s", backingFs)
|
|
| 160 | 162 |
return nil, graphdriver.ErrIncompatibleFS |
| 161 | 163 |
case graphdriver.FsMagicBtrfs: |
| 162 | 164 |
// Support for OverlayFS on BTRFS was added in kernel 4.7 |
| 163 | 165 |
// See https://btrfs.wiki.kernel.org/index.php/Changelog |
| 164 | 166 |
if kernel.CompareKernelVersion(*v, kernel.VersionInfo{Kernel: 4, Major: 7, Minor: 0}) < 0 {
|
| 165 | 167 |
if !opts.overrideKernelCheck {
|
| 166 |
- logrus.Errorf("'overlay2' requires kernel 4.7 to use on %s", backingFs)
|
|
| 168 |
+ logger.Errorf("'overlay2' requires kernel 4.7 to use on %s", backingFs)
|
|
| 167 | 169 |
return nil, graphdriver.ErrIncompatibleFS |
| 168 | 170 |
} |
| 169 |
- logrus.Warn("Using pre-4.7.0 kernel for overlay2 on btrfs, may require kernel update")
|
|
| 171 |
+ logger.Warn("Using pre-4.7.0 kernel for overlay2 on btrfs, may require kernel update")
|
|
| 170 | 172 |
} |
| 171 | 173 |
} |
| 172 | 174 |
|
| 173 | 175 |
if kernel.CompareKernelVersion(*v, kernel.VersionInfo{Kernel: 4, Major: 0, Minor: 0}) < 0 {
|
| 174 | 176 |
if opts.overrideKernelCheck {
|
| 175 |
- logrus.Warn("Using pre-4.0.0 kernel for overlay2, mount failures may require kernel update")
|
|
| 177 |
+ logger.Warn("Using pre-4.0.0 kernel for overlay2, mount failures may require kernel update")
|
|
| 176 | 178 |
} else {
|
| 177 | 179 |
if err := supportsMultipleLowerDir(testdir); err != nil {
|
| 178 |
- logrus.Debugf("Multiple lower dirs not supported: %v", err)
|
|
| 180 |
+ logger.Debugf("Multiple lower dirs not supported: %v", err)
|
|
| 179 | 181 |
return nil, graphdriver.ErrNotSupported |
| 180 | 182 |
} |
| 181 | 183 |
} |
| ... | ... |
@@ -189,7 +191,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 189 | 189 |
return nil, overlayutils.ErrDTypeNotSupported("overlay2", backingFs)
|
| 190 | 190 |
} |
| 191 | 191 |
// allow running without d_type only for existing setups (#27443) |
| 192 |
- logrus.Warn(overlayutils.ErrDTypeNotSupported("overlay2", backingFs))
|
|
| 192 |
+ logger.Warn(overlayutils.ErrDTypeNotSupported("overlay2", backingFs))
|
|
| 193 | 193 |
} |
| 194 | 194 |
|
| 195 | 195 |
rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps) |
| ... | ... |
@@ -225,7 +227,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap |
| 225 | 225 |
return nil, fmt.Errorf("Storage Option overlay2.size only supported for backingFS XFS. Found %v", backingFs)
|
| 226 | 226 |
} |
| 227 | 227 |
|
| 228 |
- logrus.Debugf("backingFs=%s, projectQuotaSupported=%v", backingFs, projectQuotaSupported)
|
|
| 228 |
+ logger.Debugf("backingFs=%s, projectQuotaSupported=%v", backingFs, projectQuotaSupported)
|
|
| 229 | 229 |
|
| 230 | 230 |
return d, nil |
| 231 | 231 |
} |
| ... | ... |
@@ -274,14 +276,14 @@ func supportsOverlay() error {
|
| 274 | 274 |
return nil |
| 275 | 275 |
} |
| 276 | 276 |
} |
| 277 |
- logrus.Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
|
|
| 277 |
+ logrus.WithField("storage-driver", "overlay2").Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
|
|
| 278 | 278 |
return graphdriver.ErrNotSupported |
| 279 | 279 |
} |
| 280 | 280 |
|
| 281 | 281 |
func useNaiveDiff(home string) bool {
|
| 282 | 282 |
useNaiveDiffLock.Do(func() {
|
| 283 | 283 |
if err := doesSupportNativeDiff(home); err != nil {
|
| 284 |
- logrus.Warnf("Not using native diff for overlay2, this may cause degraded performance for building images: %v", err)
|
|
| 284 |
+ logrus.WithField("storage-driver", "overlay2").Warnf("Not using native diff for overlay2, this may cause degraded performance for building images: %v", err)
|
|
| 285 | 285 |
useNaiveDiffOnly = true |
| 286 | 286 |
} |
| 287 | 287 |
}) |
| ... | ... |
@@ -516,7 +518,7 @@ func (d *Driver) Remove(id string) error {
|
| 516 | 516 |
lid, err := ioutil.ReadFile(path.Join(dir, "link")) |
| 517 | 517 |
if err == nil {
|
| 518 | 518 |
if err := os.RemoveAll(path.Join(d.home, linkDir, string(lid))); err != nil {
|
| 519 |
- logrus.Debugf("Failed to remove link: %v", err)
|
|
| 519 |
+ logrus.WithField("storage-driver", "overlay2").Debugf("Failed to remove link: %v", err)
|
|
| 520 | 520 |
} |
| 521 | 521 |
} |
| 522 | 522 |
|
| ... | ... |
@@ -553,11 +555,11 @@ func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr e |
| 553 | 553 |
if retErr != nil {
|
| 554 | 554 |
if c := d.ctr.Decrement(mergedDir); c <= 0 {
|
| 555 | 555 |
if mntErr := unix.Unmount(mergedDir, 0); mntErr != nil {
|
| 556 |
- logrus.Errorf("error unmounting %v: %v", mergedDir, mntErr)
|
|
| 556 |
+ logrus.WithField("storage-driver", "overlay2").Errorf("error unmounting %v: %v", mergedDir, mntErr)
|
|
| 557 | 557 |
} |
| 558 | 558 |
// Cleanup the created merged directory; see the comment in Put's rmdir |
| 559 | 559 |
if rmErr := unix.Rmdir(mergedDir); rmErr != nil && !os.IsNotExist(rmErr) {
|
| 560 |
- logrus.Debugf("Failed to remove %s: %v: %v", id, rmErr, err)
|
|
| 560 |
+ logrus.WithField("storage-driver", "overlay2").Debugf("Failed to remove %s: %v: %v", id, rmErr, err)
|
|
| 561 | 561 |
} |
| 562 | 562 |
} |
| 563 | 563 |
} |
| ... | ... |
@@ -640,11 +642,12 @@ func (d *Driver) Put(id string) error {
|
| 640 | 640 |
} |
| 641 | 641 |
|
| 642 | 642 |
mountpoint := path.Join(dir, "merged") |
| 643 |
+ logger := logrus.WithField("storage-driver", "overlay2")
|
|
| 643 | 644 |
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
| 644 | 645 |
return nil |
| 645 | 646 |
} |
| 646 | 647 |
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
| 647 |
- logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err)
|
|
| 648 |
+ logger.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err)
|
|
| 648 | 649 |
} |
| 649 | 650 |
// Remove the mountpoint here. Removing the mountpoint (in newer kernels) |
| 650 | 651 |
// will cause all other instances of this mount in other mount namespaces |
| ... | ... |
@@ -654,7 +657,7 @@ func (d *Driver) Put(id string) error {
|
| 654 | 654 |
// fail on older kernels which don't have |
| 655 | 655 |
// torvalds/linux@8ed936b5671bfb33d89bc60bdcc7cf0470ba52fe applied. |
| 656 | 656 |
if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {
|
| 657 |
- logrus.Debugf("Failed to remove %s overlay: %v", id, err)
|
|
| 657 |
+ logger.Debugf("Failed to remove %s overlay: %v", id, err)
|
|
| 658 | 658 |
} |
| 659 | 659 |
return nil |
| 660 | 660 |
} |
| ... | ... |
@@ -695,7 +698,7 @@ func (d *Driver) ApplyDiff(id string, parent string, diff io.Reader) (size int64 |
| 695 | 695 |
|
| 696 | 696 |
applyDir := d.getDiffPath(id) |
| 697 | 697 |
|
| 698 |
- logrus.Debugf("Applying tar in %s", applyDir)
|
|
| 698 |
+ logrus.WithField("storage-driver", "overlay2").Debugf("Applying tar in %s", applyDir)
|
|
| 699 | 699 |
// Overlay doesn't need the parent id to apply the diff |
| 700 | 700 |
if err := untar(diff, applyDir, &archive.TarOptions{
|
| 701 | 701 |
UIDMaps: d.uidMaps, |
| ... | ... |
@@ -733,7 +736,7 @@ func (d *Driver) Diff(id, parent string) (io.ReadCloser, error) {
|
| 733 | 733 |
} |
| 734 | 734 |
|
| 735 | 735 |
diffPath := d.getDiffPath(id) |
| 736 |
- logrus.Debugf("Tar with options on %s", diffPath)
|
|
| 736 |
+ logrus.WithField("storage-driver", "overlay2").Debugf("Tar with options on %s", diffPath)
|
|
| 737 | 737 |
return archive.TarWithOptions(diffPath, &archive.TarOptions{
|
| 738 | 738 |
Compression: archive.Uncompressed, |
| 739 | 739 |
UIDMaps: d.uidMaps, |
| ... | ... |
@@ -37,7 +37,7 @@ type Logger struct{}
|
| 37 | 37 |
|
| 38 | 38 |
// Log wraps log message from ZFS driver with a prefix '[zfs]'. |
| 39 | 39 |
func (*Logger) Log(cmd []string) {
|
| 40 |
- logrus.Debugf("[zfs] %s", strings.Join(cmd, " "))
|
|
| 40 |
+ logrus.WithField("storage-driver", "zfs").Debugf("[zfs] %s", strings.Join(cmd, " "))
|
|
| 41 | 41 |
} |
| 42 | 42 |
|
| 43 | 43 |
// Init returns a new ZFS driver. |
| ... | ... |
@@ -46,14 +46,16 @@ func (*Logger) Log(cmd []string) {
|
| 46 | 46 |
func Init(base string, opt []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
|
| 47 | 47 |
var err error |
| 48 | 48 |
|
| 49 |
+ logger := logrus.WithField("storage-driver", "zfs")
|
|
| 50 |
+ |
|
| 49 | 51 |
if _, err := exec.LookPath("zfs"); err != nil {
|
| 50 |
- logrus.Debugf("[zfs] zfs command is not available: %v", err)
|
|
| 52 |
+ logger.Debugf("zfs command is not available: %v", err)
|
|
| 51 | 53 |
return nil, graphdriver.ErrPrerequisites |
| 52 | 54 |
} |
| 53 | 55 |
|
| 54 | 56 |
file, err := os.OpenFile("/dev/zfs", os.O_RDWR, 600)
|
| 55 | 57 |
if err != nil {
|
| 56 |
- logrus.Debugf("[zfs] cannot open /dev/zfs: %v", err)
|
|
| 58 |
+ logger.Debugf("cannot open /dev/zfs: %v", err)
|
|
| 57 | 59 |
return nil, graphdriver.ErrPrerequisites |
| 58 | 60 |
} |
| 59 | 61 |
defer file.Close() |
| ... | ... |
@@ -151,7 +153,7 @@ func lookupZfsDataset(rootdir string) (string, error) {
|
| 151 | 151 |
} |
| 152 | 152 |
for _, m := range mounts {
|
| 153 | 153 |
if err := unix.Stat(m.Mountpoint, &stat); err != nil {
|
| 154 |
- logrus.Debugf("[zfs] failed to stat '%s' while scanning for zfs mount: %v", m.Mountpoint, err)
|
|
| 154 |
+ logrus.WithField("storage-driver", "zfs").Debugf("failed to stat '%s' while scanning for zfs mount: %v", m.Mountpoint, err)
|
|
| 155 | 155 |
continue // may fail on fuse file systems |
| 156 | 156 |
} |
| 157 | 157 |
|
| ... | ... |
@@ -364,10 +366,10 @@ func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr e |
| 364 | 364 |
if retErr != nil {
|
| 365 | 365 |
if c := d.ctr.Decrement(mountpoint); c <= 0 {
|
| 366 | 366 |
if mntErr := unix.Unmount(mountpoint, 0); mntErr != nil {
|
| 367 |
- logrus.Errorf("Error unmounting %v: %v", mountpoint, mntErr)
|
|
| 367 |
+ logrus.WithField("storage-driver", "zfs").Errorf("Error unmounting %v: %v", mountpoint, mntErr)
|
|
| 368 | 368 |
} |
| 369 | 369 |
if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) {
|
| 370 |
- logrus.Debugf("Failed to remove %s: %v", id, rmErr)
|
|
| 370 |
+ logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr)
|
|
| 371 | 371 |
} |
| 372 | 372 |
|
| 373 | 373 |
} |
| ... | ... |
@@ -376,7 +378,7 @@ func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr e |
| 376 | 376 |
|
| 377 | 377 |
filesystem := d.zfsPath(id) |
| 378 | 378 |
options := label.FormatMountLabel("", mountLabel)
|
| 379 |
- logrus.Debugf(`[zfs] mount("%s", "%s", "%s")`, filesystem, mountpoint, options)
|
|
| 379 |
+ logrus.WithField("storage-driver", "zfs").Debugf(`mount("%s", "%s", "%s")`, filesystem, mountpoint, options)
|
|
| 380 | 380 |
|
| 381 | 381 |
rootUID, rootGID, err := idtools.GetRootUIDGID(d.uidMaps, d.gidMaps) |
| 382 | 382 |
if err != nil {
|
| ... | ... |
@@ -407,13 +409,15 @@ func (d *Driver) Put(id string) error {
|
| 407 | 407 |
return nil |
| 408 | 408 |
} |
| 409 | 409 |
|
| 410 |
- logrus.Debugf(`[zfs] unmount("%s")`, mountpoint)
|
|
| 410 |
+ logger := logrus.WithField("storage-driver", "zfs")
|
|
| 411 |
+ |
|
| 412 |
+ logger.Debugf(`unmount("%s")`, mountpoint)
|
|
| 411 | 413 |
|
| 412 | 414 |
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
| 413 |
- logrus.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
|
|
| 415 |
+ logger.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
|
|
| 414 | 416 |
} |
| 415 | 417 |
if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {
|
| 416 |
- logrus.Debugf("Failed to remove %s mount point %s: %v", id, mountpoint, err)
|
|
| 418 |
+ logger.Debugf("Failed to remove %s mount point %s: %v", id, mountpoint, err)
|
|
| 417 | 419 |
} |
| 418 | 420 |
|
| 419 | 421 |
return nil |
| ... | ... |
@@ -17,7 +17,7 @@ func checkRootdirFs(rootdir string) error {
|
| 17 | 17 |
|
| 18 | 18 |
// on FreeBSD buf.Fstypename contains ['z', 'f', 's', 0 ... ] |
| 19 | 19 |
if (buf.Fstypename[0] != 122) || (buf.Fstypename[1] != 102) || (buf.Fstypename[2] != 115) || (buf.Fstypename[3] != 0) {
|
| 20 |
- logrus.Debugf("[zfs] no zfs dataset found for rootdir '%s'", rootdir)
|
|
| 20 |
+ logrus.WithField("storage-driver", "zfs").Debugf("no zfs dataset found for rootdir '%s'", rootdir)
|
|
| 21 | 21 |
return graphdriver.ErrPrerequisites |
| 22 | 22 |
} |
| 23 | 23 |
|
| ... | ... |
@@ -16,7 +16,7 @@ func checkRootdirFs(rootDir string) error {
|
| 16 | 16 |
} |
| 17 | 17 |
|
| 18 | 18 |
if fsMagic != graphdriver.FsMagicZfs {
|
| 19 |
- logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("driver", "zfs").Error("No zfs dataset found for root")
|
|
| 19 |
+ logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("storage-driver", "zfs").Error("No zfs dataset found for root")
|
|
| 20 | 20 |
return graphdriver.ErrPrerequisites |
| 21 | 21 |
} |
| 22 | 22 |
|