aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-21 20:09:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-21 20:09:07 -0500
commit769cb858c23ba7379ea27208624b444cd7b61af2 (patch)
treeba4227309416ae19d56ac7191dbb4fd0c1784a8c
parentb49249d10324d0fd6fb29725c2807dfd80d0edbc (diff)
parent9acbd26b0a5ac4a3d52d31034feb3d935e39032a (diff)
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French: "Misc small cifs fixes" * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: cifs: eliminate cifsERROR variable cifs: don't compare uniqueids in cifs_prime_dcache unless server inode numbers are in use cifs: fix double-free of "string" in cifs_parse_mount_options
-rw-r--r--fs/cifs/cifs_debug.h6
-rw-r--r--fs/cifs/cifsfs.c1
-rw-r--r--fs/cifs/connect.c9
-rw-r--r--fs/cifs/readdir.c19
4 files changed, 18 insertions, 17 deletions
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index 86e92ef2abc..69ae3d3c3b3 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -37,7 +37,6 @@ void dump_smb(void *, int);
37#define CIFS_TIMER 0x04 37#define CIFS_TIMER 0x04
38 38
39extern int cifsFYI; 39extern int cifsFYI;
40extern int cifsERROR;
41 40
42/* 41/*
43 * debug ON 42 * debug ON
@@ -64,10 +63,7 @@ do { \
64 63
65/* error event message: e.g., i/o error */ 64/* error event message: e.g., i/o error */
66#define cifserror(fmt, ...) \ 65#define cifserror(fmt, ...) \
67do { \ 66 printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
68 if (cifsERROR) \
69 printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
70} while (0)
71 67
72#define cERROR(set, fmt, ...) \ 68#define cERROR(set, fmt, ...) \
73do { \ 69do { \
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index ce9f3c5421b..f653835d067 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -54,7 +54,6 @@
54#endif 54#endif
55 55
56int cifsFYI = 0; 56int cifsFYI = 0;
57int cifsERROR = 1;
58int traceSMB = 0; 57int traceSMB = 0;
59bool enable_oplocks = true; 58bool enable_oplocks = true;
60unsigned int linuxExtEnabled = 1; 59unsigned int linuxExtEnabled = 1;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7635b5db26a..17c3643e595 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1624,14 +1624,11 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1624 case Opt_unc: 1624 case Opt_unc:
1625 string = vol->UNC; 1625 string = vol->UNC;
1626 vol->UNC = match_strdup(args); 1626 vol->UNC = match_strdup(args);
1627 if (vol->UNC == NULL) { 1627 if (vol->UNC == NULL)
1628 kfree(string);
1629 goto out_nomem; 1628 goto out_nomem;
1630 }
1631 1629
1632 convert_delimiter(vol->UNC, '\\'); 1630 convert_delimiter(vol->UNC, '\\');
1633 if (vol->UNC[0] != '\\' || vol->UNC[1] != '\\') { 1631 if (vol->UNC[0] != '\\' || vol->UNC[1] != '\\') {
1634 kfree(string);
1635 printk(KERN_ERR "CIFS: UNC Path does not " 1632 printk(KERN_ERR "CIFS: UNC Path does not "
1636 "begin with // or \\\\\n"); 1633 "begin with // or \\\\\n");
1637 goto cifs_parse_mount_err; 1634 goto cifs_parse_mount_err;
@@ -1687,10 +1684,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1687 1684
1688 string = vol->prepath; 1685 string = vol->prepath;
1689 vol->prepath = match_strdup(args); 1686 vol->prepath = match_strdup(args);
1690 if (vol->prepath == NULL) { 1687 if (vol->prepath == NULL)
1691 kfree(string);
1692 goto out_nomem; 1688 goto out_nomem;
1693 }
1694 /* Compare old prefixpath= option to new one */ 1689 /* Compare old prefixpath= option to new one */
1695 if (!string || strcmp(string, vol->prepath)) 1690 if (!string || strcmp(string, vol->prepath))
1696 printk(KERN_WARNING "CIFS: the value of the " 1691 printk(KERN_WARNING "CIFS: the value of the "
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 6002fdc920a..cdd6ff48246 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -78,6 +78,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
78 struct dentry *dentry, *alias; 78 struct dentry *dentry, *alias;
79 struct inode *inode; 79 struct inode *inode;
80 struct super_block *sb = parent->d_inode->i_sb; 80 struct super_block *sb = parent->d_inode->i_sb;
81 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
81 82
82 cFYI(1, "%s: for %s", __func__, name->name); 83 cFYI(1, "%s: for %s", __func__, name->name);
83 84
@@ -91,10 +92,20 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
91 int err; 92 int err;
92 93
93 inode = dentry->d_inode; 94 inode = dentry->d_inode;
94 /* update inode in place if i_ino didn't change */ 95 if (inode) {
95 if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { 96 /*
96 cifs_fattr_to_inode(inode, fattr); 97 * If we're generating inode numbers, then we don't
97 goto out; 98 * want to clobber the existing one with the one that
99 * the readdir code created.
100 */
101 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
102 fattr->cf_uniqueid = CIFS_I(inode)->uniqueid;
103
104 /* update inode in place if i_ino didn't change */
105 if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
106 cifs_fattr_to_inode(inode, fattr);
107 goto out;
108 }
98 } 109 }
99 err = d_invalidate(dentry); 110 err = d_invalidate(dentry);
100 dput(dentry); 111 dput(dentry);