diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-10 12:28:55 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-10 12:28:55 -0400 |
| commit | 2dbd3cac87250a0d44e07acc86c4224a08522709 (patch) | |
| tree | 4f31fdf50bfe64616aca1c4e2405930fd5b15e84 /fs | |
| parent | a77c005887a6d6f318117176791efa0ef7fcca80 (diff) | |
| parent | 7255e716b1757dc10fa5e3a4d2eaab303ff9f7b6 (diff) | |
Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux
Pull nfsd fixes from Bruce Fields:
"Small fixes for two bugs and two warnings"
* 'for-3.10' of git://linux-nfs.org/~bfields/linux:
nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error
SUNRPC: fix decoding of optional gss-proxy xdr fields
SUNRPC: Refactor gssx_dec_option_array() to kill uninitialized warning
nfsd4: don't allow owner override on 4.1 CLAIM_FH opens
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/nfsd/nfs4proc.c | 15 | ||||
| -rw-r--r-- | fs/nfsd/nfs4recover.c | 12 |
2 files changed, 18 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 8ae5abfe6ba2..27d74a294515 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
| @@ -279,6 +279,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, str | |||
| 279 | { | 279 | { |
| 280 | struct svc_fh *current_fh = &cstate->current_fh; | 280 | struct svc_fh *current_fh = &cstate->current_fh; |
| 281 | __be32 status; | 281 | __be32 status; |
| 282 | int accmode = 0; | ||
| 282 | 283 | ||
| 283 | /* We don't know the target directory, and therefore can not | 284 | /* We don't know the target directory, and therefore can not |
| 284 | * set the change info | 285 | * set the change info |
| @@ -290,9 +291,19 @@ do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, str | |||
| 290 | 291 | ||
| 291 | open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && | 292 | open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && |
| 292 | (open->op_iattr.ia_size == 0); | 293 | (open->op_iattr.ia_size == 0); |
| 294 | /* | ||
| 295 | * In the delegation case, the client is telling us about an | ||
| 296 | * open that it *already* performed locally, some time ago. We | ||
| 297 | * should let it succeed now if possible. | ||
| 298 | * | ||
| 299 | * In the case of a CLAIM_FH open, on the other hand, the client | ||
| 300 | * may be counting on us to enforce permissions (the Linux 4.1 | ||
| 301 | * client uses this for normal opens, for example). | ||
| 302 | */ | ||
| 303 | if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH) | ||
| 304 | accmode = NFSD_MAY_OWNER_OVERRIDE; | ||
| 293 | 305 | ||
| 294 | status = do_open_permission(rqstp, current_fh, open, | 306 | status = do_open_permission(rqstp, current_fh, open, accmode); |
| 295 | NFSD_MAY_OWNER_OVERRIDE); | ||
| 296 | 307 | ||
| 297 | return status; | 308 | return status; |
| 298 | } | 309 | } |
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 899ca26dd194..4e9a21db867a 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
| @@ -146,7 +146,7 @@ out_no_tfm: | |||
| 146 | * then disable recovery tracking. | 146 | * then disable recovery tracking. |
| 147 | */ | 147 | */ |
| 148 | static void | 148 | static void |
| 149 | legacy_recdir_name_error(int error) | 149 | legacy_recdir_name_error(struct nfs4_client *clp, int error) |
| 150 | { | 150 | { |
| 151 | printk(KERN_ERR "NFSD: unable to generate recoverydir " | 151 | printk(KERN_ERR "NFSD: unable to generate recoverydir " |
| 152 | "name (%d).\n", error); | 152 | "name (%d).\n", error); |
| @@ -159,9 +159,7 @@ legacy_recdir_name_error(int error) | |||
| 159 | if (error == -ENOENT) { | 159 | if (error == -ENOENT) { |
| 160 | printk(KERN_ERR "NFSD: disabling legacy clientid tracking. " | 160 | printk(KERN_ERR "NFSD: disabling legacy clientid tracking. " |
| 161 | "Reboot recovery will not function correctly!\n"); | 161 | "Reboot recovery will not function correctly!\n"); |
| 162 | 162 | nfsd4_client_tracking_exit(clp->net); | |
| 163 | /* the argument is ignored by the legacy exit function */ | ||
| 164 | nfsd4_client_tracking_exit(NULL); | ||
| 165 | } | 163 | } |
| 166 | } | 164 | } |
| 167 | 165 | ||
| @@ -184,7 +182,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
| 184 | 182 | ||
| 185 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); | 183 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); |
| 186 | if (status) | 184 | if (status) |
| 187 | return legacy_recdir_name_error(status); | 185 | return legacy_recdir_name_error(clp, status); |
| 188 | 186 | ||
| 189 | status = nfs4_save_creds(&original_cred); | 187 | status = nfs4_save_creds(&original_cred); |
| 190 | if (status < 0) | 188 | if (status < 0) |
| @@ -341,7 +339,7 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp) | |||
| 341 | 339 | ||
| 342 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); | 340 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); |
| 343 | if (status) | 341 | if (status) |
| 344 | return legacy_recdir_name_error(status); | 342 | return legacy_recdir_name_error(clp, status); |
| 345 | 343 | ||
| 346 | status = mnt_want_write_file(nn->rec_file); | 344 | status = mnt_want_write_file(nn->rec_file); |
| 347 | if (status) | 345 | if (status) |
| @@ -601,7 +599,7 @@ nfsd4_check_legacy_client(struct nfs4_client *clp) | |||
| 601 | 599 | ||
| 602 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); | 600 | status = nfs4_make_rec_clidname(dname, &clp->cl_name); |
| 603 | if (status) { | 601 | if (status) { |
| 604 | legacy_recdir_name_error(status); | 602 | legacy_recdir_name_error(clp, status); |
| 605 | return status; | 603 | return status; |
| 606 | } | 604 | } |
| 607 | 605 | ||
