mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
pvfs: handle SHARING_VIOLATION and OPLOCK_NOT_GRANTED in pvfs_can_delete/rename()
If the caller asks for the odb_lock return it also if we return NT_STATUS_SHARING_VIOLATION or NT_STATUS_OPLOCK_NOT_GRANTED so that the caller can add the pending notification. metze (This used to be commit daab9cb11eb540fae7ec3c024a586f5fd02cfc71)
This commit is contained in:
parent
1cd2008aa4
commit
f56ff422a5
@ -1447,7 +1447,19 @@ NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs,
|
||||
status = pvfs_access_check_simple(pvfs, req, name, SEC_STD_DELETE);
|
||||
}
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
/*
|
||||
* if it's a sharing violation or we got no oplock
|
||||
* only keep the lock if the caller requested access
|
||||
* to the lock
|
||||
*/
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_OPLOCK_NOT_GRANTED)) {
|
||||
if (lckp) {
|
||||
*lckp = lck;
|
||||
} else {
|
||||
talloc_free(lck);
|
||||
}
|
||||
} else if (!NT_STATUS_IS_OK(status)) {
|
||||
talloc_free(lck);
|
||||
*lckp = lck;
|
||||
} else if (lckp != NULL) {
|
||||
@ -1487,7 +1499,19 @@ NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs,
|
||||
0,
|
||||
SEC_STD_DELETE);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
/*
|
||||
* if it's a sharing violation or we got no oplock
|
||||
* only keep the lock if the caller requested access
|
||||
* to the lock
|
||||
*/
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_OPLOCK_NOT_GRANTED)) {
|
||||
if (lckp) {
|
||||
*lckp = lck;
|
||||
} else {
|
||||
talloc_free(lck);
|
||||
}
|
||||
} else if (!NT_STATUS_IS_OK(status)) {
|
||||
talloc_free(lck);
|
||||
*lckp = lck;
|
||||
} else if (lckp != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user