aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-04-10 17:07:33 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-04-10 17:12:03 -0400
commit5fdccfef483d088fcc533b282bf6953579d6d6f4 (patch)
tree08e4cf2966a798b011d901a6b058aac7b95a3b98 /fs/cifs
parentfc64005c93090c052637f63578d810b037abb1a1 (diff)
cifs: kill more bogus checks in ->...xattr() methods
none of that stuff can ever be called for NULL or negative dentry. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/xattr.c42
1 files changed, 6 insertions, 36 deletions
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 612de933431f..159547c8a40b 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -42,19 +42,11 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
42 int rc = -EOPNOTSUPP; 42 int rc = -EOPNOTSUPP;
43#ifdef CONFIG_CIFS_XATTR 43#ifdef CONFIG_CIFS_XATTR
44 unsigned int xid; 44 unsigned int xid;
45 struct cifs_sb_info *cifs_sb; 45 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
46 struct tcon_link *tlink; 46 struct tcon_link *tlink;
47 struct cifs_tcon *pTcon; 47 struct cifs_tcon *pTcon;
48 struct super_block *sb;
49 char *full_path = NULL; 48 char *full_path = NULL;
50 49
51 if (direntry == NULL)
52 return -EIO;
53 if (d_really_is_negative(direntry))
54 return -EIO;
55 sb = direntry->d_sb;
56
57 cifs_sb = CIFS_SB(sb);
58 tlink = cifs_sb_tlink(cifs_sb); 50 tlink = cifs_sb_tlink(cifs_sb);
59 if (IS_ERR(tlink)) 51 if (IS_ERR(tlink))
60 return PTR_ERR(tlink); 52 return PTR_ERR(tlink);
@@ -101,19 +93,12 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
101 int rc = -EOPNOTSUPP; 93 int rc = -EOPNOTSUPP;
102#ifdef CONFIG_CIFS_XATTR 94#ifdef CONFIG_CIFS_XATTR
103 unsigned int xid; 95 unsigned int xid;
104 struct cifs_sb_info *cifs_sb; 96 struct super_block *sb = direntry->d_sb;
97 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
105 struct tcon_link *tlink; 98 struct tcon_link *tlink;
106 struct cifs_tcon *pTcon; 99 struct cifs_tcon *pTcon;
107 struct super_block *sb;
108 char *full_path; 100 char *full_path;
109 101
110 if (direntry == NULL)
111 return -EIO;
112 if (d_really_is_negative(direntry))
113 return -EIO;
114 sb = direntry->d_sb;
115
116 cifs_sb = CIFS_SB(sb);
117 tlink = cifs_sb_tlink(cifs_sb); 102 tlink = cifs_sb_tlink(cifs_sb);
118 if (IS_ERR(tlink)) 103 if (IS_ERR(tlink))
119 return PTR_ERR(tlink); 104 return PTR_ERR(tlink);
@@ -234,19 +219,12 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
234 ssize_t rc = -EOPNOTSUPP; 219 ssize_t rc = -EOPNOTSUPP;
235#ifdef CONFIG_CIFS_XATTR 220#ifdef CONFIG_CIFS_XATTR
236 unsigned int xid; 221 unsigned int xid;
237 struct cifs_sb_info *cifs_sb; 222 struct super_block *sb = direntry->d_sb;
223 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
238 struct tcon_link *tlink; 224 struct tcon_link *tlink;
239 struct cifs_tcon *pTcon; 225 struct cifs_tcon *pTcon;
240 struct super_block *sb;
241 char *full_path; 226 char *full_path;
242 227
243 if (direntry == NULL)
244 return -EIO;
245 if (d_really_is_negative(direntry))
246 return -EIO;
247 sb = direntry->d_sb;
248
249 cifs_sb = CIFS_SB(sb);
250 tlink = cifs_sb_tlink(cifs_sb); 228 tlink = cifs_sb_tlink(cifs_sb);
251 if (IS_ERR(tlink)) 229 if (IS_ERR(tlink))
252 return PTR_ERR(tlink); 230 return PTR_ERR(tlink);
@@ -368,19 +346,11 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
368 ssize_t rc = -EOPNOTSUPP; 346 ssize_t rc = -EOPNOTSUPP;
369#ifdef CONFIG_CIFS_XATTR 347#ifdef CONFIG_CIFS_XATTR
370 unsigned int xid; 348 unsigned int xid;
371 struct cifs_sb_info *cifs_sb; 349 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
372 struct tcon_link *tlink; 350 struct tcon_link *tlink;
373 struct cifs_tcon *pTcon; 351 struct cifs_tcon *pTcon;
374 struct super_block *sb;
375 char *full_path; 352 char *full_path;
376 353
377 if (direntry == NULL)
378 return -EIO;
379 if (d_really_is_negative(direntry))
380 return -EIO;
381 sb = direntry->d_sb;
382
383 cifs_sb = CIFS_SB(sb);
384 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 354 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
385 return -EOPNOTSUPP; 355 return -EOPNOTSUPP;
386 356