diff options
author | Steve French <sfrench@us.ibm.com> | 2006-07-14 18:37:11 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-08-11 17:27:07 -0400 |
commit | 3a5ff61c18659443f76bad6cf06f60103046de5d (patch) | |
tree | 541e341724b50b11c598c9790370d460f189586b /fs/cifs/cifssmb.c | |
parent | 9f737633e6ee54fc174282d49b2559bd2208391d (diff) |
[CIFS] Do not time out posix brl requests when using new posix setfileinfo
request and do not time out slow requests to a server that is still responding
well to other threads
Suggested by jra of Samba team
Signed-off-by: Steve French <sfrench@us.ibm.com>
(cherry picked from 89b57148115479eef074b8d3f86c4c86c96ac969 commit)
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 19678c575dfc..c03c42ee9eb9 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1484,6 +1484,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1484 | char *data_offset; | 1484 | char *data_offset; |
1485 | struct cifs_posix_lock *parm_data; | 1485 | struct cifs_posix_lock *parm_data; |
1486 | int rc = 0; | 1486 | int rc = 0; |
1487 | int timeout = 0; | ||
1487 | int bytes_returned = 0; | 1488 | int bytes_returned = 0; |
1488 | __u16 params, param_offset, offset, byte_count, count; | 1489 | __u16 params, param_offset, offset, byte_count, count; |
1489 | 1490 | ||
@@ -1503,7 +1504,6 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1503 | pSMB->MaxSetupCount = 0; | 1504 | pSMB->MaxSetupCount = 0; |
1504 | pSMB->Reserved = 0; | 1505 | pSMB->Reserved = 0; |
1505 | pSMB->Flags = 0; | 1506 | pSMB->Flags = 0; |
1506 | pSMB->Timeout = 0; | ||
1507 | pSMB->Reserved2 = 0; | 1507 | pSMB->Reserved2 = 0; |
1508 | param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; | 1508 | param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; |
1509 | offset = param_offset + params; | 1509 | offset = param_offset + params; |
@@ -1529,8 +1529,13 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1529 | (((char *) &pSMB->hdr.Protocol) + offset); | 1529 | (((char *) &pSMB->hdr.Protocol) + offset); |
1530 | 1530 | ||
1531 | parm_data->lock_type = cpu_to_le16(lock_type); | 1531 | parm_data->lock_type = cpu_to_le16(lock_type); |
1532 | if(waitFlag) | 1532 | if(waitFlag) { |
1533 | timeout = 3; /* blocking operation, no timeout */ | ||
1533 | parm_data->lock_flags = cpu_to_le16(1); | 1534 | parm_data->lock_flags = cpu_to_le16(1); |
1535 | pSMB->Timeout = cpu_to_le32(-1); | ||
1536 | } else | ||
1537 | pSMB->Timeout = 0; | ||
1538 | |||
1534 | parm_data->pid = cpu_to_le32(current->tgid); | 1539 | parm_data->pid = cpu_to_le32(current->tgid); |
1535 | parm_data->start = cpu_to_le64(pLockData->fl_start); | 1540 | parm_data->start = cpu_to_le64(pLockData->fl_start); |
1536 | parm_data->length = cpu_to_le64(len); /* normalize negative numbers */ | 1541 | parm_data->length = cpu_to_le64(len); /* normalize negative numbers */ |
@@ -1542,7 +1547,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1542 | pSMB->hdr.smb_buf_length += byte_count; | 1547 | pSMB->hdr.smb_buf_length += byte_count; |
1543 | pSMB->ByteCount = cpu_to_le16(byte_count); | 1548 | pSMB->ByteCount = cpu_to_le16(byte_count); |
1544 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1549 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1545 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1550 | (struct smb_hdr *) pSMBr, &bytes_returned, timeout); |
1546 | if (rc) { | 1551 | if (rc) { |
1547 | cFYI(1, ("Send error in Posix Lock = %d", rc)); | 1552 | cFYI(1, ("Send error in Posix Lock = %d", rc)); |
1548 | } else if (get_flag) { | 1553 | } else if (get_flag) { |