pvfs_open: pass O_NONBLOCK to open() so that we'll not block with kernel oplocks
authorStefan Metzmacher <metze@samba.org>
Mon, 10 Mar 2008 11:48:02 +0000 (12:48 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2008 16:35:06 +0000 (17:35 +0100)
metze
(This used to be commit eeb0b8c349552517b521f1b8d7d9341e0ef630f2)

source4/ntvfs/posix/pvfs_open.c

index ceda3a6da0b5aa58d5b3aa623b802389b1a045e5..8a949daa87a9ac18a40e5290a11cbb244fdf417f 100644 (file)
@@ -600,7 +600,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
        mode = pvfs_fileperms(pvfs, attrib);
 
        /* create the file */
        mode = pvfs_fileperms(pvfs, attrib);
 
        /* create the file */
-       fd = open(name->full_name, flags | O_CREAT | O_EXCL, mode);
+       fd = open(name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode);
        if (fd == -1) {
                return pvfs_map_errno(pvfs, errno);
        }
        if (fd == -1) {
                return pvfs_map_errno(pvfs, errno);
        }
@@ -1303,7 +1303,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
        }
 
        /* do the actual open */
        }
 
        /* do the actual open */
-       fd = open(f->handle->name->full_name, flags);
+       fd = open(f->handle->name->full_name, flags | O_NONBLOCK);
        if (fd == -1) {
                talloc_free(lck);
                return pvfs_map_errno(f->pvfs, errno);
        if (fd == -1) {
                talloc_free(lck);
                return pvfs_map_errno(f->pvfs, errno);