diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-01 15:05:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-01 15:05:13 -0500 |
commit | cc73dc04c7b3e18ac20ef7770d4964765e4d6ddf (patch) | |
tree | 70578f9996176d888ddbd7955b86db13d9ae77d4 /fs/cifs | |
parent | 5140a8ceaa369d362d0ab7a438a5d99c75ee098d (diff) | |
parent | c51bb0ea40ca038da26b1fa7d450f4078124af03 (diff) |
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French:
"Four cifs fixes (including for kernel bug #53221 and samba bug #9519)"
* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
cifs: bugfix for unreclaimed writeback pages in cifs_writev_requeue()
cifs: set MAY_SIGN when sec=krb5
POSIX extensions disabled on client due to illegal O_EXCL flag sent to Samba
cifs: ensure that cifs_get_root() only traverses directories
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 5 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 5 | ||||
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 12 |
4 files changed, 19 insertions, 5 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 4bad7b16271f..1a052c0eee8e 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -564,6 +564,11 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
564 | dentry = ERR_PTR(-ENOENT); | 564 | dentry = ERR_PTR(-ENOENT); |
565 | break; | 565 | break; |
566 | } | 566 | } |
567 | if (!S_ISDIR(dir->i_mode)) { | ||
568 | dput(dentry); | ||
569 | dentry = ERR_PTR(-ENOTDIR); | ||
570 | break; | ||
571 | } | ||
567 | 572 | ||
568 | /* skip separators */ | 573 | /* skip separators */ |
569 | while (*s == sep) | 574 | while (*s == sep) |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 00e12f2d626b..7353bc5d73d7 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1909,8 +1909,11 @@ cifs_writev_requeue(struct cifs_writedata *wdata) | |||
1909 | } while (rc == -EAGAIN); | 1909 | } while (rc == -EAGAIN); |
1910 | 1910 | ||
1911 | for (i = 0; i < wdata->nr_pages; i++) { | 1911 | for (i = 0; i < wdata->nr_pages; i++) { |
1912 | if (rc != 0) | 1912 | if (rc != 0) { |
1913 | SetPageError(wdata->pages[i]); | 1913 | SetPageError(wdata->pages[i]); |
1914 | end_page_writeback(wdata->pages[i]); | ||
1915 | page_cache_release(wdata->pages[i]); | ||
1916 | } | ||
1914 | unlock_page(wdata->pages[i]); | 1917 | unlock_page(wdata->pages[i]); |
1915 | } | 1918 | } |
1916 | 1919 | ||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 4474a57f30ab..54125e04fd0c 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1031,7 +1031,7 @@ static int cifs_parse_security_flavors(char *value, | |||
1031 | 1031 | ||
1032 | switch (match_token(value, cifs_secflavor_tokens, args)) { | 1032 | switch (match_token(value, cifs_secflavor_tokens, args)) { |
1033 | case Opt_sec_krb5: | 1033 | case Opt_sec_krb5: |
1034 | vol->secFlg |= CIFSSEC_MAY_KRB5; | 1034 | vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MAY_SIGN; |
1035 | break; | 1035 | break; |
1036 | case Opt_sec_krb5i: | 1036 | case Opt_sec_krb5i: |
1037 | vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MUST_SIGN; | 1037 | vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MUST_SIGN; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index c16d2a018ab8..8c0d85577314 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "cifs_fs_sb.h" | 43 | #include "cifs_fs_sb.h" |
44 | #include "fscache.h" | 44 | #include "fscache.h" |
45 | 45 | ||
46 | |||
46 | static inline int cifs_convert_flags(unsigned int flags) | 47 | static inline int cifs_convert_flags(unsigned int flags) |
47 | { | 48 | { |
48 | if ((flags & O_ACCMODE) == O_RDONLY) | 49 | if ((flags & O_ACCMODE) == O_RDONLY) |
@@ -72,10 +73,15 @@ static u32 cifs_posix_convert_flags(unsigned int flags) | |||
72 | else if ((flags & O_ACCMODE) == O_RDWR) | 73 | else if ((flags & O_ACCMODE) == O_RDWR) |
73 | posix_flags = SMB_O_RDWR; | 74 | posix_flags = SMB_O_RDWR; |
74 | 75 | ||
75 | if (flags & O_CREAT) | 76 | if (flags & O_CREAT) { |
76 | posix_flags |= SMB_O_CREAT; | 77 | posix_flags |= SMB_O_CREAT; |
77 | if (flags & O_EXCL) | 78 | if (flags & O_EXCL) |
78 | posix_flags |= SMB_O_EXCL; | 79 | posix_flags |= SMB_O_EXCL; |
80 | } else if (flags & O_EXCL) | ||
81 | cFYI(1, "Application %s pid %d has incorrectly set O_EXCL flag" | ||
82 | "but not O_CREAT on file open. Ignoring O_EXCL", | ||
83 | current->comm, current->tgid); | ||
84 | |||
79 | if (flags & O_TRUNC) | 85 | if (flags & O_TRUNC) |
80 | posix_flags |= SMB_O_TRUNC; | 86 | posix_flags |= SMB_O_TRUNC; |
81 | /* be safe and imply O_SYNC for O_DSYNC */ | 87 | /* be safe and imply O_SYNC for O_DSYNC */ |