diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-05-26 10:01:59 +0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-26 18:07:02 +0000 |
commit | fa2989f4473413a86890066aa3a5676a53b541e4 (patch) | |
tree | a033c59307ba77ae0819e818aec7d68178d11d4d /fs/cifs/link.c | |
parent | c28c89fc43e3f81436efc4748837534d4d46f90c (diff) | |
download | linux-3.10-fa2989f4473413a86890066aa3a5676a53b541e4.tar.gz linux-3.10-fa2989f4473413a86890066aa3a5676a53b541e4.tar.bz2 linux-3.10-fa2989f4473413a86890066aa3a5676a53b541e4.zip |
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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index ce417a9764a..1a6a388cf5d 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) |