aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-11-19 07:51:14 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-12-09 11:21:20 -0500
commit4d152e2c9a6a3e3556ce5da7782a9e2836edbe0f (patch)
tree3c3b778275aaeed90a0e81a708508e113bab606d /fs
parent2941b0e91ba68b1f77140e556307e00616a5bb46 (diff)
sunrpc: add a generic rq_flags field to svc_rqst and move rq_secure to it
In a later patch, we're going to need some atomic bit flags. Since that field will need to be an unsigned long, we mitigate that space consumption by migrating some other bitflags to the new field. Start with the rq_secure flag. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfscache.c4
-rw-r--r--fs/nfsd/nfsfh.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 122f69185ef5..83a9694ec485 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -490,7 +490,7 @@ found_entry:
490 /* From the hall of fame of impractical attacks: 490 /* From the hall of fame of impractical attacks:
491 * Is this a user who tries to snoop on the cache? */ 491 * Is this a user who tries to snoop on the cache? */
492 rtn = RC_DOIT; 492 rtn = RC_DOIT;
493 if (!rqstp->rq_secure && rp->c_secure) 493 if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && rp->c_secure)
494 goto out; 494 goto out;
495 495
496 /* Compose RPC reply header */ 496 /* Compose RPC reply header */
@@ -579,7 +579,7 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
579 spin_lock(&b->cache_lock); 579 spin_lock(&b->cache_lock);
580 drc_mem_usage += bufsize; 580 drc_mem_usage += bufsize;
581 lru_put_end(b, rp); 581 lru_put_end(b, rp);
582 rp->c_secure = rqstp->rq_secure; 582 rp->c_secure = test_bit(RQ_SECURE, &rqstp->rq_flags);
583 rp->c_type = cachetype; 583 rp->c_type = cachetype;
584 rp->c_state = RC_DONE; 584 rp->c_state = RC_DONE;
585 spin_unlock(&b->cache_lock); 585 spin_unlock(&b->cache_lock);
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 88026fc6a981..965b478d50fc 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -86,7 +86,7 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
86 int flags = nfsexp_flags(rqstp, exp); 86 int flags = nfsexp_flags(rqstp, exp);
87 87
88 /* Check if the request originated from a secure port. */ 88 /* Check if the request originated from a secure port. */
89 if (!rqstp->rq_secure && !(flags & NFSEXP_INSECURE_PORT)) { 89 if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && !(flags & NFSEXP_INSECURE_PORT)) {
90 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]); 90 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
91 dprintk("nfsd: request from insecure port %s!\n", 91 dprintk("nfsd: request from insecure port %s!\n",
92 svc_print_addr(rqstp, buf, sizeof(buf))); 92 svc_print_addr(rqstp, buf, sizeof(buf)));