diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-01 12:45:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-01 12:45:47 -0400 |
commit | 1e848913f017cb84256ef5fe4cdd5cc4b935bd36 (patch) | |
tree | 8cd37e89c93d8288a568a67aeba0ef5d6a7b6ff7 /fs | |
parent | 6c310bc1acdd02110182a2ec6efa3e7571a3b80c (diff) | |
parent | f9c72d10d6fbf949558cd088389a42213ed7b12d (diff) |
Merge branch 'for-4.0' of git://linux-nfs.org/~bfields/linux
Pull nfsd fixes from Bruce Fields:
"Two main issues:
- We found that turning on pNFS by default (when it's configured at
build time) was too aggressive, so we want to switch the default
before the 4.0 release.
- Recent client changes to increase open parallelism uncovered a
serious bug lurking in the server's open code.
Also fix a krb5/selinux regression.
The rest is mainly smaller pNFS fixes"
* 'for-4.0' of git://linux-nfs.org/~bfields/linux:
sunrpc: make debugfs file creation failure non-fatal
nfsd: require an explicit option to enable pNFS
NFSD: Fix bad update of layout in nfsd4_return_file_layout
NFSD: Take care the return value from nfsd4_encode_stateid
NFSD: Printk blocklayout length and offset as format 0x%llx
nfsd: return correct lockowner when there is a race on hash insert
nfsd: return correct openowner when there is a race to put one in the hash
NFSD: Put exports after nfsd4_layout_verify fail
NFSD: Error out when register_shrinker() fail
NFSD: Take care the return value from nfsd4_decode_stateid
NFSD: Check layout type when returning client layouts
NFSD: restore trace event lost in mismerge
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/blocklayout.c | 2 | ||||
-rw-r--r-- | fs/nfsd/blocklayoutxdr.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfs4layouts.c | 12 | ||||
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 20 | ||||
-rw-r--r-- | fs/nfsd/nfscache.c | 6 |
7 files changed, 36 insertions, 16 deletions
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index cdbc78c72542..03d647bf195d 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c | |||
@@ -137,7 +137,7 @@ nfsd4_block_proc_layoutget(struct inode *inode, const struct svc_fh *fhp, | |||
137 | seg->offset = iomap.offset; | 137 | seg->offset = iomap.offset; |
138 | seg->length = iomap.length; | 138 | seg->length = iomap.length; |
139 | 139 | ||
140 | dprintk("GET: %lld:%lld %d\n", bex->foff, bex->len, bex->es); | 140 | dprintk("GET: 0x%llx:0x%llx %d\n", bex->foff, bex->len, bex->es); |
141 | return 0; | 141 | return 0; |
142 | 142 | ||
143 | out_error: | 143 | out_error: |
diff --git a/fs/nfsd/blocklayoutxdr.c b/fs/nfsd/blocklayoutxdr.c index 9da89fddab33..9aa2796da90d 100644 --- a/fs/nfsd/blocklayoutxdr.c +++ b/fs/nfsd/blocklayoutxdr.c | |||
@@ -122,19 +122,19 @@ nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp, | |||
122 | 122 | ||
123 | p = xdr_decode_hyper(p, &bex.foff); | 123 | p = xdr_decode_hyper(p, &bex.foff); |
124 | if (bex.foff & (block_size - 1)) { | 124 | if (bex.foff & (block_size - 1)) { |
125 | dprintk("%s: unaligned offset %lld\n", | 125 | dprintk("%s: unaligned offset 0x%llx\n", |
126 | __func__, bex.foff); | 126 | __func__, bex.foff); |
127 | goto fail; | 127 | goto fail; |
128 | } | 128 | } |
129 | p = xdr_decode_hyper(p, &bex.len); | 129 | p = xdr_decode_hyper(p, &bex.len); |
130 | if (bex.len & (block_size - 1)) { | 130 | if (bex.len & (block_size - 1)) { |
131 | dprintk("%s: unaligned length %lld\n", | 131 | dprintk("%s: unaligned length 0x%llx\n", |
132 | __func__, bex.foff); | 132 | __func__, bex.foff); |
133 | goto fail; | 133 | goto fail; |
134 | } | 134 | } |
135 | p = xdr_decode_hyper(p, &bex.soff); | 135 | p = xdr_decode_hyper(p, &bex.soff); |
136 | if (bex.soff & (block_size - 1)) { | 136 | if (bex.soff & (block_size - 1)) { |
137 | dprintk("%s: unaligned disk offset %lld\n", | 137 | dprintk("%s: unaligned disk offset 0x%llx\n", |
138 | __func__, bex.soff); | 138 | __func__, bex.soff); |
139 | goto fail; | 139 | goto fail; |
140 | } | 140 | } |
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 1028a0629543..6904213a4363 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c | |||
@@ -118,7 +118,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp) | |||
118 | { | 118 | { |
119 | struct super_block *sb = exp->ex_path.mnt->mnt_sb; | 119 | struct super_block *sb = exp->ex_path.mnt->mnt_sb; |
120 | 120 | ||
121 | if (exp->ex_flags & NFSEXP_NOPNFS) | 121 | if (!(exp->ex_flags & NFSEXP_PNFS)) |
122 | return; | 122 | return; |
123 | 123 | ||
124 | if (sb->s_export_op->get_uuid && | 124 | if (sb->s_export_op->get_uuid && |
@@ -440,15 +440,14 @@ nfsd4_return_file_layout(struct nfs4_layout *lp, struct nfsd4_layout_seg *seg, | |||
440 | list_move_tail(&lp->lo_perstate, reaplist); | 440 | list_move_tail(&lp->lo_perstate, reaplist); |
441 | return; | 441 | return; |
442 | } | 442 | } |
443 | end = seg->offset; | 443 | lo->offset = layout_end(seg); |
444 | } else { | 444 | } else { |
445 | /* retain the whole layout segment on a split. */ | 445 | /* retain the whole layout segment on a split. */ |
446 | if (layout_end(seg) < end) { | 446 | if (layout_end(seg) < end) { |
447 | dprintk("%s: split not supported\n", __func__); | 447 | dprintk("%s: split not supported\n", __func__); |
448 | return; | 448 | return; |
449 | } | 449 | } |
450 | 450 | end = seg->offset; | |
451 | lo->offset = layout_end(seg); | ||
452 | } | 451 | } |
453 | 452 | ||
454 | layout_update_len(lo, end); | 453 | layout_update_len(lo, end); |
@@ -513,6 +512,9 @@ nfsd4_return_client_layouts(struct svc_rqst *rqstp, | |||
513 | 512 | ||
514 | spin_lock(&clp->cl_lock); | 513 | spin_lock(&clp->cl_lock); |
515 | list_for_each_entry_safe(ls, n, &clp->cl_lo_states, ls_perclnt) { | 514 | list_for_each_entry_safe(ls, n, &clp->cl_lo_states, ls_perclnt) { |
515 | if (ls->ls_layout_type != lrp->lr_layout_type) | ||
516 | continue; | ||
517 | |||
516 | if (lrp->lr_return_type == RETURN_FSID && | 518 | if (lrp->lr_return_type == RETURN_FSID && |
517 | !fh_fsid_match(&ls->ls_stid.sc_file->fi_fhandle, | 519 | !fh_fsid_match(&ls->ls_stid.sc_file->fi_fhandle, |
518 | &cstate->current_fh.fh_handle)) | 520 | &cstate->current_fh.fh_handle)) |
@@ -587,6 +589,8 @@ nfsd4_cb_layout_fail(struct nfs4_layout_stateid *ls) | |||
587 | 589 | ||
588 | rpc_ntop((struct sockaddr *)&clp->cl_addr, addr_str, sizeof(addr_str)); | 590 | rpc_ntop((struct sockaddr *)&clp->cl_addr, addr_str, sizeof(addr_str)); |
589 | 591 | ||
592 | trace_layout_recall_fail(&ls->ls_stid.sc_stateid); | ||
593 | |||
590 | printk(KERN_WARNING | 594 | printk(KERN_WARNING |
591 | "nfsd: client %s failed to respond to layout recall. " | 595 | "nfsd: client %s failed to respond to layout recall. " |
592 | " Fencing..\n", addr_str); | 596 | " Fencing..\n", addr_str); |
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d30bea8d0277..92b9d97aff4f 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1237,8 +1237,8 @@ nfsd4_getdeviceinfo(struct svc_rqst *rqstp, | |||
1237 | nfserr = ops->proc_getdeviceinfo(exp->ex_path.mnt->mnt_sb, gdp); | 1237 | nfserr = ops->proc_getdeviceinfo(exp->ex_path.mnt->mnt_sb, gdp); |
1238 | 1238 | ||
1239 | gdp->gd_notify_types &= ops->notify_types; | 1239 | gdp->gd_notify_types &= ops->notify_types; |
1240 | exp_put(exp); | ||
1241 | out: | 1240 | out: |
1241 | exp_put(exp); | ||
1242 | return nfserr; | 1242 | return nfserr; |
1243 | } | 1243 | } |
1244 | 1244 | ||
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d2f2c37dc2db..8ba1d888f1e6 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3221,7 +3221,7 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfsd4_open *open, | |||
3221 | } else | 3221 | } else |
3222 | nfs4_free_openowner(&oo->oo_owner); | 3222 | nfs4_free_openowner(&oo->oo_owner); |
3223 | spin_unlock(&clp->cl_lock); | 3223 | spin_unlock(&clp->cl_lock); |
3224 | return oo; | 3224 | return ret; |
3225 | } | 3225 | } |
3226 | 3226 | ||
3227 | static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { | 3227 | static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { |
@@ -5062,7 +5062,7 @@ alloc_init_lock_stateowner(unsigned int strhashval, struct nfs4_client *clp, | |||
5062 | } else | 5062 | } else |
5063 | nfs4_free_lockowner(&lo->lo_owner); | 5063 | nfs4_free_lockowner(&lo->lo_owner); |
5064 | spin_unlock(&clp->cl_lock); | 5064 | spin_unlock(&clp->cl_lock); |
5065 | return lo; | 5065 | return ret; |
5066 | } | 5066 | } |
5067 | 5067 | ||
5068 | static void | 5068 | static void |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index df5e66caf100..5fb7e78169a6 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1562,7 +1562,11 @@ nfsd4_decode_layoutget(struct nfsd4_compoundargs *argp, | |||
1562 | p = xdr_decode_hyper(p, &lgp->lg_seg.offset); | 1562 | p = xdr_decode_hyper(p, &lgp->lg_seg.offset); |
1563 | p = xdr_decode_hyper(p, &lgp->lg_seg.length); | 1563 | p = xdr_decode_hyper(p, &lgp->lg_seg.length); |
1564 | p = xdr_decode_hyper(p, &lgp->lg_minlength); | 1564 | p = xdr_decode_hyper(p, &lgp->lg_minlength); |
1565 | nfsd4_decode_stateid(argp, &lgp->lg_sid); | 1565 | |
1566 | status = nfsd4_decode_stateid(argp, &lgp->lg_sid); | ||
1567 | if (status) | ||
1568 | return status; | ||
1569 | |||
1566 | READ_BUF(4); | 1570 | READ_BUF(4); |
1567 | lgp->lg_maxcount = be32_to_cpup(p++); | 1571 | lgp->lg_maxcount = be32_to_cpup(p++); |
1568 | 1572 | ||
@@ -1580,7 +1584,11 @@ nfsd4_decode_layoutcommit(struct nfsd4_compoundargs *argp, | |||
1580 | p = xdr_decode_hyper(p, &lcp->lc_seg.offset); | 1584 | p = xdr_decode_hyper(p, &lcp->lc_seg.offset); |
1581 | p = xdr_decode_hyper(p, &lcp->lc_seg.length); | 1585 | p = xdr_decode_hyper(p, &lcp->lc_seg.length); |
1582 | lcp->lc_reclaim = be32_to_cpup(p++); | 1586 | lcp->lc_reclaim = be32_to_cpup(p++); |
1583 | nfsd4_decode_stateid(argp, &lcp->lc_sid); | 1587 | |
1588 | status = nfsd4_decode_stateid(argp, &lcp->lc_sid); | ||
1589 | if (status) | ||
1590 | return status; | ||
1591 | |||
1584 | READ_BUF(4); | 1592 | READ_BUF(4); |
1585 | lcp->lc_newoffset = be32_to_cpup(p++); | 1593 | lcp->lc_newoffset = be32_to_cpup(p++); |
1586 | if (lcp->lc_newoffset) { | 1594 | if (lcp->lc_newoffset) { |
@@ -1628,7 +1636,11 @@ nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp, | |||
1628 | READ_BUF(16); | 1636 | READ_BUF(16); |
1629 | p = xdr_decode_hyper(p, &lrp->lr_seg.offset); | 1637 | p = xdr_decode_hyper(p, &lrp->lr_seg.offset); |
1630 | p = xdr_decode_hyper(p, &lrp->lr_seg.length); | 1638 | p = xdr_decode_hyper(p, &lrp->lr_seg.length); |
1631 | nfsd4_decode_stateid(argp, &lrp->lr_sid); | 1639 | |
1640 | status = nfsd4_decode_stateid(argp, &lrp->lr_sid); | ||
1641 | if (status) | ||
1642 | return status; | ||
1643 | |||
1632 | READ_BUF(4); | 1644 | READ_BUF(4); |
1633 | lrp->lrf_body_len = be32_to_cpup(p++); | 1645 | lrp->lrf_body_len = be32_to_cpup(p++); |
1634 | if (lrp->lrf_body_len > 0) { | 1646 | if (lrp->lrf_body_len > 0) { |
@@ -4123,7 +4135,7 @@ nfsd4_encode_layoutreturn(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
4123 | return nfserr_resource; | 4135 | return nfserr_resource; |
4124 | *p++ = cpu_to_be32(lrp->lrs_present); | 4136 | *p++ = cpu_to_be32(lrp->lrs_present); |
4125 | if (lrp->lrs_present) | 4137 | if (lrp->lrs_present) |
4126 | nfsd4_encode_stateid(xdr, &lrp->lr_sid); | 4138 | return nfsd4_encode_stateid(xdr, &lrp->lr_sid); |
4127 | return nfs_ok; | 4139 | return nfs_ok; |
4128 | } | 4140 | } |
4129 | #endif /* CONFIG_NFSD_PNFS */ | 4141 | #endif /* CONFIG_NFSD_PNFS */ |
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 83a9694ec485..46ec934f5dee 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c | |||
@@ -165,13 +165,17 @@ int nfsd_reply_cache_init(void) | |||
165 | { | 165 | { |
166 | unsigned int hashsize; | 166 | unsigned int hashsize; |
167 | unsigned int i; | 167 | unsigned int i; |
168 | int status = 0; | ||
168 | 169 | ||
169 | max_drc_entries = nfsd_cache_size_limit(); | 170 | max_drc_entries = nfsd_cache_size_limit(); |
170 | atomic_set(&num_drc_entries, 0); | 171 | atomic_set(&num_drc_entries, 0); |
171 | hashsize = nfsd_hashsize(max_drc_entries); | 172 | hashsize = nfsd_hashsize(max_drc_entries); |
172 | maskbits = ilog2(hashsize); | 173 | maskbits = ilog2(hashsize); |
173 | 174 | ||
174 | register_shrinker(&nfsd_reply_cache_shrinker); | 175 | status = register_shrinker(&nfsd_reply_cache_shrinker); |
176 | if (status) | ||
177 | return status; | ||
178 | |||
175 | drc_slab = kmem_cache_create("nfsd_drc", sizeof(struct svc_cacherep), | 179 | drc_slab = kmem_cache_create("nfsd_drc", sizeof(struct svc_cacherep), |
176 | 0, 0, NULL); | 180 | 0, 0, NULL); |
177 | if (!drc_slab) | 181 | if (!drc_slab) |