aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2010-04-05 01:59:14 -0400
committerSteve French <sfrench@us.ibm.com>2010-04-06 13:24:26 -0400
commitf05337c6ac48d19d354e0640a8eb8fc884f82bcc (patch)
tree7be4407febc50dba022112281f1f6d04eb2a5a22 /fs/cifs/cifssmb.c
parent6513a81e9325d712f1bfb9a1d7b750134e49ff18 (diff)
not overwriting file_lock structure after GET_LK
If we have preventing lock, cifs should overwrite file_lock structure with info about preventing lock. If we haven't preventing lock, cifs should leave it unchanged except for the lock type (change it to F_UNLCK). Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index f213b8ae43c1..184a399749a6 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1810,8 +1810,21 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1810 } 1810 }
1811 parm_data = (struct cifs_posix_lock *) 1811 parm_data = (struct cifs_posix_lock *)
1812 ((char *)&pSMBr->hdr.Protocol + data_offset); 1812 ((char *)&pSMBr->hdr.Protocol + data_offset);
1813 if (parm_data->lock_type == cpu_to_le16(CIFS_UNLCK)) 1813 if (parm_data->lock_type == __constant_cpu_to_le16(CIFS_UNLCK))
1814 pLockData->fl_type = F_UNLCK; 1814 pLockData->fl_type = F_UNLCK;
1815 else {
1816 if (parm_data->lock_type ==
1817 __constant_cpu_to_le16(CIFS_RDLCK))
1818 pLockData->fl_type = F_RDLCK;
1819 else if (parm_data->lock_type ==
1820 __constant_cpu_to_le16(CIFS_WRLCK))
1821 pLockData->fl_type = F_WRLCK;
1822
1823 pLockData->fl_start = parm_data->start;
1824 pLockData->fl_end = parm_data->start +
1825 parm_data->length - 1;
1826 pLockData->fl_pid = parm_data->pid;
1827 }
1815 } 1828 }
1816 1829
1817plk_err_exit: 1830plk_err_exit: