« Previous | Next » 

Revision ab03b63d

IDab03b63d7a9c7978d51e56c191f0b86888d121dc

Added by Sripathi Kodi over 13 years ago

[virtio-9p] open should not return EBADF

When 9P server fails to create a file due to permission problems it should
return EPERM. However the current 9P2000.L code returns EBADF. EBADF is NOT
a valid return value from open() call.

The problem is because we do not preserve the errno variable properly. If the
file open had failed, the call to close() on the fd in v9fs_post_lcreate()
fails and sets errno to EBADF. We should preserve the errno that we got from
open() and we should call close() only if we had a valid fd.

Signed-off-by: Sripathi Kodi <>
Signed-off-by: Venkateswararao Jujjuri <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences