summaryrefslogtreecommitdiff
path: root/fs/cifs/link.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-05-26 10:01:59 +0400
committerSteve French <sfrench@us.ibm.com>2011-05-26 18:07:02 +0000
commitfa2989f4473413a86890066aa3a5676a53b541e4 (patch)
treea033c59307ba77ae0819e818aec7d68178d11d4d /fs/cifs/link.c
parentc28c89fc43e3f81436efc4748837534d4d46f90c (diff)
CIFS: Use pid saved from cifsFileInfo in writepages and set_file_size
We need it to make them work with mandatory locking style because we can fail in a situation like when kernel need to flush dirty pages and there is a lock held by a process who opened file. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index ce417a9764a3..1a6a388cf5d8 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -184,6 +184,7 @@ CIFSCreateMFSymLink(const int xid, struct cifsTconInfo *tcon,
__u16 netfid = 0;
u8 *buf;
unsigned int bytes_written = 0;
+ struct cifs_io_parms io_parms;
buf = kmalloc(CIFS_MF_SYMLINK_FILE_SIZE, GFP_KERNEL);
if (!buf)
@@ -203,10 +204,13 @@ CIFSCreateMFSymLink(const int xid, struct cifsTconInfo *tcon,
return rc;
}
- rc = CIFSSMBWrite(xid, tcon, netfid,
- CIFS_MF_SYMLINK_FILE_SIZE /* length */,
- 0 /* offset */,
- &bytes_written, buf, NULL, 0);
+ io_parms.netfid = netfid;
+ io_parms.pid = current->tgid;
+ io_parms.tcon = tcon;
+ io_parms.offset = 0;
+ io_parms.length = CIFS_MF_SYMLINK_FILE_SIZE;
+
+ rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, buf, NULL, 0);
CIFSSMBClose(xid, tcon, netfid);
kfree(buf);
if (rc != 0)