summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_open.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-01-31 20:20:24 +0300
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-02-15 11:09:17 +0100
commit738b2abe784bc38bdaf1abc913a401e0e732e188 (patch)
tree65360ea9dabca5e165e1cbdf96426b93384bf39a /source4/ntvfs/posix/pvfs_open.c
parent3c5f537302294dc5306cffed5dcd57221ac2c96d (diff)
downloadsamba-738b2abe784bc38bdaf1abc913a401e0e732e188.tar.gz
samba-738b2abe784bc38bdaf1abc913a401e0e732e188.tar.bz2
samba-738b2abe784bc38bdaf1abc913a401e0e732e188.zip
s4: Don't grant level II oplock to a file with byte-range locks.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Tue Feb 15 11:09:17 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/ntvfs/posix/pvfs_open.c')
-rw-r--r--source4/ntvfs/posix/pvfs_open.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index da32c7f9b6..08a54f8e42 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -1197,7 +1197,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
struct pvfs_file *f;
struct ntvfs_handle *h;
NTSTATUS status;
- int fd;
+ int fd, count;
struct odb_lock *lck;
uint32_t create_options;
uint32_t create_options_must_ignore_mask;
@@ -1569,6 +1569,16 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
f->handle->fd = fd;
+ status = brl_count(f->pvfs->brl_context, f->brl_handle, &count);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(lck);
+ return status;
+ }
+
+ if (count != 0) {
+ oplock_level = OPLOCK_NONE;
+ }
+
/* now really mark the file as open */
status = odb_open_file(lck, f->handle, name->full_name,
&f->handle->fd, name->dos.write_time,