mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix rename error handling for VFS2 kernfs.
The non-errno error was causing panics before. PiperOrigin-RevId: 339969348
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user