aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-05-26 02:01:59 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-26 14:07:02 -0400
commitfa2989f4473413a86890066aa3a5676a53b541e4 (patch)
treea033c59307ba77ae0819e818aec7d68178d11d4d /fs/cifs/dir.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/dir.c')
-rw-r--r--fs/cifs/dir.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 9ea65cf36714..0521492f5b3b 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -357,6 +357,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
357 struct cifs_sb_info *cifs_sb; 357 struct cifs_sb_info *cifs_sb;
358 struct tcon_link *tlink; 358 struct tcon_link *tlink;
359 struct cifsTconInfo *pTcon; 359 struct cifsTconInfo *pTcon;
360 struct cifs_io_parms io_parms;
360 char *full_path = NULL; 361 char *full_path = NULL;
361 struct inode *newinode = NULL; 362 struct inode *newinode = NULL;
362 int oplock = 0; 363 int oplock = 0;
@@ -439,16 +440,19 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
439 * timestamps in, but we can reuse it safely */ 440 * timestamps in, but we can reuse it safely */
440 441
441 pdev = (struct win_dev *)buf; 442 pdev = (struct win_dev *)buf;
443 io_parms.netfid = fileHandle;
444 io_parms.pid = current->tgid;
445 io_parms.tcon = pTcon;
446 io_parms.offset = 0;
447 io_parms.length = sizeof(struct win_dev);
442 if (S_ISCHR(mode)) { 448 if (S_ISCHR(mode)) {
443 memcpy(pdev->type, "IntxCHR", 8); 449 memcpy(pdev->type, "IntxCHR", 8);
444 pdev->major = 450 pdev->major =
445 cpu_to_le64(MAJOR(device_number)); 451 cpu_to_le64(MAJOR(device_number));
446 pdev->minor = 452 pdev->minor =
447 cpu_to_le64(MINOR(device_number)); 453 cpu_to_le64(MINOR(device_number));
448 rc = CIFSSMBWrite(xid, pTcon, 454 rc = CIFSSMBWrite(xid, &io_parms,
449 fileHandle, 455 &bytes_written, (char *)pdev,
450 sizeof(struct win_dev),
451 0, &bytes_written, (char *)pdev,
452 NULL, 0); 456 NULL, 0);
453 } else if (S_ISBLK(mode)) { 457 } else if (S_ISBLK(mode)) {
454 memcpy(pdev->type, "IntxBLK", 8); 458 memcpy(pdev->type, "IntxBLK", 8);
@@ -456,10 +460,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
456 cpu_to_le64(MAJOR(device_number)); 460 cpu_to_le64(MAJOR(device_number));
457 pdev->minor = 461 pdev->minor =
458 cpu_to_le64(MINOR(device_number)); 462 cpu_to_le64(MINOR(device_number));
459 rc = CIFSSMBWrite(xid, pTcon, 463 rc = CIFSSMBWrite(xid, &io_parms,
460 fileHandle, 464 &bytes_written, (char *)pdev,
461 sizeof(struct win_dev),
462 0, &bytes_written, (char *)pdev,
463 NULL, 0); 465 NULL, 0);
464 } /* else if (S_ISFIFO) */ 466 } /* else if (S_ISFIFO) */
465 CIFSSMBClose(xid, pTcon, fileHandle); 467 CIFSSMBClose(xid, pTcon, fileHandle);