diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-11 13:11:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-11 15:14:16 -0400 |
commit | 17280175c587469b34757263c7cfc608f0ea2334 (patch) | |
tree | 34a3008bfd1055e9fdb0557ea563484b67433797 /fs/nfs/delegation.c | |
parent | 5ffaf8554163d9f3873988ce2f9977f6c6f408d2 (diff) |
NFS: Fix a number of sparse warnings
Fix a number of "warning: symbol 'foo' was not declared. Should it be
static?" conditions.
Fix 2 cases of "warning: Using plain integer as NULL pointer"
fs/nfs/delegation.c:263:31: warning: restricted fmode_t degrades to integer
- We want to allow upgrades to a WRITE delegation, but should otherwise
consider servers that hand out duplicate delegations to be borken.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r-- | fs/nfs/delegation.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 12de88353eeb..89af1d269274 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -256,11 +256,14 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
256 | /* | 256 | /* |
257 | * Deal with broken servers that hand out two | 257 | * Deal with broken servers that hand out two |
258 | * delegations for the same file. | 258 | * delegations for the same file. |
259 | * Allow for upgrades to a WRITE delegation, but | ||
260 | * nothing else. | ||
259 | */ | 261 | */ |
260 | dfprintk(FILE, "%s: server %s handed out " | 262 | dfprintk(FILE, "%s: server %s handed out " |
261 | "a duplicate delegation!\n", | 263 | "a duplicate delegation!\n", |
262 | __func__, clp->cl_hostname); | 264 | __func__, clp->cl_hostname); |
263 | if (delegation->type <= old_delegation->type) { | 265 | if (delegation->type == old_delegation->type || |
266 | !(delegation->type & FMODE_WRITE)) { | ||
264 | freeme = delegation; | 267 | freeme = delegation; |
265 | delegation = NULL; | 268 | delegation = NULL; |
266 | goto out; | 269 | goto out; |