This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
int i,
NTSTATUS status)
{
+ /* in SMB2 mode we also try to unlock failing lock */
+ if (req->ctx->protocol != PROTOCOL_SMB2) {
+ i--;
+ }
+
/* undo the locks we just did */
- for (i=i-1;i>=0;i--) {
+ for (;i>=0;i--) {
brl_unlock(pvfs->brl_context,
f->brl_handle,
locks[i].pid,
*/
status = brl_lock(pvfs->brl_context,
f->brl_handle,
- req->smbpid,
+ locks[pending->pending_lock].pid,
locks[pending->pending_lock].offset,
locks[pending->pending_lock].count,
rw, pending);
status = brl_lock(pvfs->brl_context,
f->brl_handle,
- req->smbpid,
+ locks[i].pid,
locks[i].offset,
locks[i].count,
rw, pending);
DLIST_ADD(f->pending_list, pending);
return NT_STATUS_OK;
}
+ /* in SMB2 mode we also try to unlock failing lock */
+ if (req->ctx->protocol != PROTOCOL_SMB2) {
+ i--;
+ }
/* undo the locks we just did */
- for (i=i-1;i>=0;i--) {
+ for (;i>=0;i--) {
brl_unlock(pvfs->brl_context,
f->brl_handle,
locks[i].pid,