From fa2989f4473413a86890066aa3a5676a53b541e4 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Thu, 26 May 2011 10:01:59 +0400 Subject: 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 Signed-off-by: Steve French --- fs/cifs/link.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'fs/cifs/link.c') 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) -- cgit v1.2.3