From eccbca6031f673d33aba989a301539e485b3357b Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 23 Feb 2012 09:37:45 -0500 Subject: [PATCH] --- yaml --- r: 288289 b: refs/heads/master c: 5bccda0ebc7c0331b81ac47d39e4b920b198b2cd h: refs/heads/master i: 288287: 5d4ae2c813e24965c237a0d532286e3ed117457a v: v3 --- [refs] | 2 +- trunk/fs/cifs/dir.c | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 5aab530aa084..7edd7aea06f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6de2ce423157d06f73d570ef7044f08c2f8697da +refs/heads/master: 5bccda0ebc7c0331b81ac47d39e4b920b198b2cd diff --git a/trunk/fs/cifs/dir.c b/trunk/fs/cifs/dir.c index 63a196b97d50..bc7e24420ac0 100644 --- a/trunk/fs/cifs/dir.c +++ b/trunk/fs/cifs/dir.c @@ -584,10 +584,26 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, * If either that or op not supported returned, follow * the normal lookup. */ - if ((rc == 0) || (rc == -ENOENT)) + switch (rc) { + case 0: + /* + * The server may allow us to open things like + * FIFOs, but the client isn't set up to deal + * with that. If it's not a regular file, just + * close it and proceed as if it were a normal + * lookup. + */ + if (newInode && !S_ISREG(newInode->i_mode)) { + CIFSSMBClose(xid, pTcon, fileHandle); + break; + } + case -ENOENT: posix_open = true; - else if ((rc == -EINVAL) || (rc != -EOPNOTSUPP)) + case -EOPNOTSUPP: + break; + default: pTcon->broken_posix_open = true; + } } if (!posix_open) rc = cifs_get_inode_info_unix(&newInode, full_path,