[linux-cifs-client] F_GETLK request - returning value
diff mbox

Message ID 49CB77EE.6090608@etersoft.ru
State New, archived
Headers show

Commit Message

Pavel Shilovsky March 26, 2009, 12:41 p.m. UTC
Hello!

I had problem with F_GETLK request in fcntl() function: it didn't return 
info about exist lock, if it prevents our lock.

Here is my patch.

        }

 plk_err_exit:


--
Best regards,
Pavel Shilovsky.

Patch
diff mbox

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 8f0f86d..aa26a3a 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1882,6 +1882,16 @@  CIFSSMBPosixLock(const int xid, struct 
cifsTconInfo *tcon,
                        ((char *)&pSMBr->hdr.Protocol + data_offset);
                if (parm_data->lock_type == cpu_to_le16(CIFS_UNLCK))
                        pLockData->fl_type = F_UNLCK;
+               else {
+                       if (parm_data->lock_type == cpu_to_le16(CIFS_RDLCK))
+                               pLockData->fl_type = F_RDLCK;
+                       else if (parm_data->lock_type == 
cpu_to_le16(CIFS_WRLCK))
+                               pLockData->fl_type = F_WRLCK;
+
+                       pLockData->fl_start = parm_data->start;
+                       pLockData->fl_end = parm_data->start + 
parm_data->length - 1;
+                       pLockData->fl_pid = parm_data->pid;
+               }