diff options
author | Dean Deng <deandeng@google.com> | 2020-10-30 17:40:28 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-30 17:42:57 -0700 |
commit | 1f25697cfe0484198784afc947ae3bdf4eb05e9b (patch) | |
tree | 9c52bf8b23468cb65cda661185187c1c014304cd /pkg/sentry/fsimpl | |
parent | ba05c6845d3d285be8c2d12d9f10a5745f722e58 (diff) |
Fix rename error handling for VFS2 kernfs.
The non-errno error was causing panics before.
PiperOrigin-RevId: 339969348
Diffstat (limited to 'pkg/sentry/fsimpl')
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/inode_impl_util.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/inode_impl_util.go b/pkg/sentry/fsimpl/kernfs/inode_impl_util.go index d9d76758a..4f78437d2 100644 --- a/pkg/sentry/fsimpl/kernfs/inode_impl_util.go +++ b/pkg/sentry/fsimpl/kernfs/inode_impl_util.go @@ -568,13 +568,6 @@ func (o *OrderedChildren) RmDir(ctx context.Context, name string, child Inode) e return o.Unlink(ctx, name, child) } -// +stateify savable -type renameAcrossDifferentImplementationsError struct{} - -func (renameAcrossDifferentImplementationsError) Error() string { - return "rename across inodes with different implementations" -} - // Rename implements Inode.Rename. // // Precondition: Rename may only be called across two directory inodes with @@ -587,7 +580,7 @@ func (renameAcrossDifferentImplementationsError) Error() string { func (o *OrderedChildren) Rename(ctx context.Context, oldname, newname string, child, dstDir Inode) error { dst, ok := dstDir.(interface{}).(*OrderedChildren) if !ok { - return renameAcrossDifferentImplementationsError{} + return syserror.ENODEV } if !o.writable || !dst.writable { return syserror.EPERM |