Address loop dev PR comments #4178

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-01-04 10:44:29 -08:00
parent b7026236f4
commit c5fa0298c1
3 changed files with 54 additions and 95 deletions

View File

@@ -85,9 +85,8 @@ func (m *Mount) Mount(target string) (err error) {
if err != nil {
return err
}
defer devFile.Close()
// Mount the loop device instead
source = devFile.Name()
source = devFile
}
if err := mountAt(chdir, source, target, m.Type, uintptr(oflags), data); err != nil {
return err