diff options
author | Dean Deng <deandeng@google.com> | 2021-01-20 16:51:59 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-20 16:55:07 -0800 |
commit | 55332aca95a55378957f89a10f21d9d1714070a5 (patch) | |
tree | 409f45199da64097861facecf65db3f5621ce27b /pkg/sentry/kernel/fd_table.go | |
parent | ca9a45f282a08a88df19c93d5968d720b5153c41 (diff) |
Move Lock/UnlockPOSIX into LockFD util.
PiperOrigin-RevId: 352904728
Diffstat (limited to 'pkg/sentry/kernel/fd_table.go')
-rw-r--r-- | pkg/sentry/kernel/fd_table.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/sentry/kernel/fd_table.go b/pkg/sentry/kernel/fd_table.go index 7aba31587..97aa679ed 100644 --- a/pkg/sentry/kernel/fd_table.go +++ b/pkg/sentry/kernel/fd_table.go @@ -153,9 +153,8 @@ func (f *FDTable) drop(ctx context.Context, file *fs.File) { // dropVFS2 drops the table reference. func (f *FDTable) dropVFS2(ctx context.Context, file *vfs.FileDescription) { - // Release any POSIX lock possibly held by the FDTable. Range {0, 0} means the - // entire file. - err := file.UnlockPOSIX(ctx, f, 0, 0, linux.SEEK_SET) + // Release any POSIX lock possibly held by the FDTable. + err := file.UnlockPOSIX(ctx, f, lock.LockRange{0, lock.LockEOF}) if err != nil && err != syserror.ENOLCK { panic(fmt.Sprintf("UnlockPOSIX failed: %v", err)) } |