mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Make unlink tests pass with goferfs
Required directory checks were being skipped when there was no child cached. Now the code always loads the child file before unlinking it. Updates #1198 PiperOrigin-RevId: 305382323
This commit is contained in:
committed by
gVisor bot
parent
dbcc59af0b
commit
5a1324625f
@@ -437,14 +437,19 @@ func (fs *filesystem) unlinkAt(ctx context.Context, rp *vfs.ResolvingPath, dir b
|
||||
flags := uint32(0)
|
||||
if dir {
|
||||
if child != nil && !child.isDir() {
|
||||
vfsObj.AbortDeleteDentry(childVFSD)
|
||||
return syserror.ENOTDIR
|
||||
}
|
||||
flags = linux.AT_REMOVEDIR
|
||||
} else {
|
||||
if child != nil && child.isDir() {
|
||||
vfsObj.AbortDeleteDentry(childVFSD)
|
||||
return syserror.EISDIR
|
||||
}
|
||||
if rp.MustBeDir() {
|
||||
if childVFSD != nil {
|
||||
vfsObj.AbortDeleteDentry(childVFSD)
|
||||
}
|
||||
return syserror.ENOTDIR
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user