Hello,

I'm seeing a write failure because another thread in ganesha doing 'open
downgrade' closed the FD the find_fd() returned. Any suggestion on how
to fix the race?

vfs_reopen2()
{...
        status = vfs_open_my_fd(myself, openflags, posix_flags, my_fd);

        if (!FSAL_IS_ERROR(status)) {
                /* Close the existing file descriptor and copy the new
                 * one over.
                 */
                vfs_close_my_fd(my_share_fd);
                *my_share_fd = fd;

vfs_write2()
{
..
        status = find_fd(&my_fd, obj_hdl, bypass, state, openflags,
                         &has_lock, &closefd, false);

        if (FSAL_IS_ERROR(status)) {
                LogDebug(COMPONENT_FSAL,
                         "find_fd failed %s", msg_fsal_err(status.major));
                goto out;
        }

        fsal_set_credentials(op_ctx->creds);

        nb_written = pwrite(my_fd, buffer, buffer_size, offset);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to