aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2010-07-20 18:24:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-07-29 19:32:17 -0400
commit69049961014992f50b10d6c3cd3cd172d4aae5ac (patch)
treed6717d7bc3eae733374cc9acb3a278a82498dced /fs
parentf9d7562fdb9dc0ada3a7aba5dbbe9d965e2a105d (diff)
gcc-4.6: nfsd: fix initialized but not read warnings
Fixes at least one real minor bug: the nfs4 recovery dir sysctl would not return its status properly. Also I finished Al's 1e41568d7378d ("Take ima_path_check() in nfsd past dentry_open() in nfsd_open()") commit, it moved the IMA code, but left the old path initializer in there. The rest is just dead code removed I think, although I was not fully sure about the "is_borc" stuff. Some more review would be still good. Found by gcc 4.6's new warnings. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c2
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--fs/nfsd/nfsproc.c2
-rw-r--r--fs/nfsd/vfs.c9
4 files changed, 2 insertions, 13 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7ab572f9f388..0b4351f8238a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3421,11 +3421,9 @@ static inline void
3421nfs4_set_lock_denied(struct file_lock *fl, struct nfsd4_lock_denied *deny) 3421nfs4_set_lock_denied(struct file_lock *fl, struct nfsd4_lock_denied *deny)
3422{ 3422{
3423 struct nfs4_stateowner *sop; 3423 struct nfs4_stateowner *sop;
3424 unsigned int hval;
3425 3424
3426 if (fl->fl_lmops == &nfsd_posix_mng_ops) { 3425 if (fl->fl_lmops == &nfsd_posix_mng_ops) {
3427 sop = (struct nfs4_stateowner *) fl->fl_owner; 3426 sop = (struct nfs4_stateowner *) fl->fl_owner;
3428 hval = lockownerid_hashval(sop->so_id);
3429 kref_get(&sop->so_ref); 3427 kref_get(&sop->so_ref);
3430 deny->ld_sop = sop; 3428 deny->ld_sop = sop;
3431 deny->ld_clientid = sop->so_client->cl_clientid; 3429 deny->ld_clientid = sop->so_client->cl_clientid;
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index b1c5be85bea5..12f0ee7d1aba 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1306,6 +1306,8 @@ static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size)
1306 return -EINVAL; 1306 return -EINVAL;
1307 1307
1308 status = nfs4_reset_recoverydir(recdir); 1308 status = nfs4_reset_recoverydir(recdir);
1309 if (status)
1310 return status;
1309 } 1311 }
1310 1312
1311 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n", 1313 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n",
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index a047ad6111ef..1edb78b96c5f 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -290,7 +290,6 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
290 * gospel of sun micro 290 * gospel of sun micro
291 */ 291 */
292 if (type != S_IFREG) { 292 if (type != S_IFREG) {
293 int is_borc = 0;
294 if (type != S_IFBLK && type != S_IFCHR) { 293 if (type != S_IFBLK && type != S_IFCHR) {
295 rdev = 0; 294 rdev = 0;
296 } else if (type == S_IFCHR && !(attr->ia_valid & ATTR_SIZE)) { 295 } else if (type == S_IFCHR && !(attr->ia_valid & ATTR_SIZE)) {
@@ -298,7 +297,6 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
298 type = S_IFIFO; 297 type = S_IFIFO;
299 } else { 298 } else {
300 /* Okay, char or block special */ 299 /* Okay, char or block special */
301 is_borc = 1;
302 if (!rdev) 300 if (!rdev)
303 rdev = wanted; 301 rdev = wanted;
304 } 302 }
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 31d32aeda2c2..3458a8f596f1 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -2052,7 +2052,6 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
2052 struct dentry *dentry, int acc) 2052 struct dentry *dentry, int acc)
2053{ 2053{
2054 struct inode *inode = dentry->d_inode; 2054 struct inode *inode = dentry->d_inode;
2055 struct path path;
2056 int err; 2055 int err;
2057 2056
2058 if (acc == NFSD_MAY_NOP) 2057 if (acc == NFSD_MAY_NOP)
@@ -2125,15 +2124,7 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
2125 if (err == -EACCES && S_ISREG(inode->i_mode) && 2124 if (err == -EACCES && S_ISREG(inode->i_mode) &&
2126 acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE)) 2125 acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE))
2127 err = inode_permission(inode, MAY_EXEC); 2126 err = inode_permission(inode, MAY_EXEC);
2128 if (err)
2129 goto nfsd_out;
2130 2127
2131 /* Do integrity (permission) checking now, but defer incrementing
2132 * IMA counts to the actual file open.
2133 */
2134 path.mnt = exp->ex_path.mnt;
2135 path.dentry = dentry;
2136nfsd_out:
2137 return err? nfserrno(err) : 0; 2128 return err? nfserrno(err) : 0;
2138} 2129}
2139 2130