diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-05-26 02:01:59 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-26 14:07:02 -0400 |
commit | fa2989f4473413a86890066aa3a5676a53b541e4 (patch) | |
tree | a033c59307ba77ae0819e818aec7d68178d11d4d /fs/cifs/link.c | |
parent | c28c89fc43e3f81436efc4748837534d4d46f90c (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.c | 12 |
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, | |||
184 | __u16 netfid = 0; | 184 | __u16 netfid = 0; |
185 | u8 *buf; | 185 | u8 *buf; |
186 | unsigned int bytes_written = 0; | 186 | unsigned int bytes_written = 0; |
187 | struct cifs_io_parms io_parms; | ||
187 | 188 | ||
188 | buf = kmalloc(CIFS_MF_SYMLINK_FILE_SIZE, GFP_KERNEL); | 189 | buf = kmalloc(CIFS_MF_SYMLINK_FILE_SIZE, GFP_KERNEL); |
189 | if (!buf) | 190 | if (!buf) |
@@ -203,10 +204,13 @@ CIFSCreateMFSymLink(const int xid, struct cifsTconInfo *tcon, | |||
203 | return rc; | 204 | return rc; |
204 | } | 205 | } |
205 | 206 | ||
206 | rc = CIFSSMBWrite(xid, tcon, netfid, | 207 | io_parms.netfid = netfid; |
207 | CIFS_MF_SYMLINK_FILE_SIZE /* length */, | 208 | io_parms.pid = current->tgid; |
208 | 0 /* offset */, | 209 | io_parms.tcon = tcon; |
209 | &bytes_written, buf, NULL, 0); | 210 | io_parms.offset = 0; |
211 | io_parms.length = CIFS_MF_SYMLINK_FILE_SIZE; | ||
212 | |||
213 | rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, buf, NULL, 0); | ||
210 | CIFSSMBClose(xid, tcon, netfid); | 214 | CIFSSMBClose(xid, tcon, netfid); |
211 | kfree(buf); | 215 | kfree(buf); |
212 | if (rc != 0) | 216 | if (rc != 0) |