diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-05-26 02:02:00 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-26 23:57:16 -0400 |
commit | d4ffff1fa9695c5b5c0bf337e208d8833b88ff2d (patch) | |
tree | acd4b6cfa7962a1cee7e9c81f11bd9ccb0d3ff24 /fs/cifs/inode.c | |
parent | 25c7f41e9234f60af30e086278f1de7974f8816f (diff) |
CIFS: Add rwpidforward mount option
Add rwpidforward mount option that switches on a mode when we forward
pid of a process who opened a file to any read and write operation.
This can prevent applications like WINE from failing on read or write
operation on a previously locked file region from the same netfd from
another process if we use mandatory brlock style.
It is actual for WINE because during a run of WINE program two processes
work on the same netfd - share the same file struct between several VFS
fds:
1) WINE-server does open and lock;
2) WINE-application does read and write.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 53ea6250a51d..e2d9dd817ba0 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -374,6 +374,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, | |||
374 | __u16 netfid; | 374 | __u16 netfid; |
375 | struct tcon_link *tlink; | 375 | struct tcon_link *tlink; |
376 | struct cifsTconInfo *tcon; | 376 | struct cifsTconInfo *tcon; |
377 | struct cifs_io_parms io_parms; | ||
377 | char buf[24]; | 378 | char buf[24]; |
378 | unsigned int bytes_read; | 379 | unsigned int bytes_read; |
379 | char *pbuf; | 380 | char *pbuf; |
@@ -405,9 +406,13 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, | |||
405 | if (rc == 0) { | 406 | if (rc == 0) { |
406 | int buf_type = CIFS_NO_BUFFER; | 407 | int buf_type = CIFS_NO_BUFFER; |
407 | /* Read header */ | 408 | /* Read header */ |
408 | rc = CIFSSMBRead(xid, tcon, netfid, | 409 | io_parms.netfid = netfid; |
409 | 24 /* length */, 0 /* offset */, | 410 | io_parms.pid = current->tgid; |
410 | &bytes_read, &pbuf, &buf_type); | 411 | io_parms.tcon = tcon; |
412 | io_parms.offset = 0; | ||
413 | io_parms.length = 24; | ||
414 | rc = CIFSSMBRead(xid, &io_parms, &bytes_read, &pbuf, | ||
415 | &buf_type); | ||
411 | if ((rc == 0) && (bytes_read >= 8)) { | 416 | if ((rc == 0) && (bytes_read >= 8)) { |
412 | if (memcmp("IntxBLK", pbuf, 8) == 0) { | 417 | if (memcmp("IntxBLK", pbuf, 8) == 0) { |
413 | cFYI(1, "Block device"); | 418 | cFYI(1, "Block device"); |