NT_STATUS_INVALID_HANDLE during file open with vfs_glusterfs

Jeremy Allison jra at samba.org
Mon Aug 5 16:40:34 UTC 2019


On Mon, Aug 05, 2019 at 07:52:37PM +0530, Anoop C S via samba-technical wrote:
> Hi all,
> 
> The following commit changed the way in which O_NONBLOCK is
> added/removed from file status flags during open.
> 
> https://git.samba.org/?p=samba.git;a=commit;h=ef582ffcf3a220b73f678d9bce0fd37800f76c54
> smbd: Always open files with O_NONBLOCK
> 
> Since O_NONBLOCK is now internally getting added unconditionally,
> storage backed by GlusterFS volumes using vfs_glusterfs produces
> *Invalid file handle* error while opening files(I tested from Windows).
> set_blocking() from open_file() is now being invoked due to the
> presence of O_NONBLOCK flag and fails at fcntl() call operating on fsp-
> >fh->fd which is obviously bad and returns EBADF.
> 
> Thus when open file descriptors are handled as fsp_extensions we may
> have to rely on VFS itself to get the job done.

Hi Anoop, can you fix this by removing the O_NONBLOCK
from the open call inside vfs_glusterfs ?

Adding the O_NONBLOCK is correct for the local filesystem
side of things, so if glusterfs needs something different
it'll need to cope.

Adding a test environment for gluster into Samba would
also be a really good way to ensure we don't cause
problems like this in the future - but currently
our base test environment is the local filesystem,
which I think is the correct decision.

Jeremy.



More information about the samba-technical mailing list