NFSD: Fix bad update of layout in nfsd4_return_file_layout
Subsystems (2)
PATCH 1/1 NFSD: Fix bad update of layout in nfsd4_return_file_layout
With return layout as, (seg is return layout, lo is record layout) seg->offset <= lo->offset and layout_end(seg) < layout_end(lo), nfsd should update lo's offset to seg's end,
and,seg->offset > lo->offset and layout_end(seg) >= layout_end(lo), nfsd should update lo's end to seg's offset.
--- fs/nfsd/nfs4layouts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/nfsd/nfs4layouts.c +2 -3
@@ -440,15 +440,14 @@ nfsd4_return_file_layout(struct nfs4_layout *lp, struct nfsd4_layout_seg *seg,list_move_tail (&lp->lo_perstate, reaplist);return ; } - end = seg->offset; + lo->offset =layout_end (seg); }else {/* retain the whole layout segment on a split. */ if (layout_end (seg) < end) {dprintk ("%s: split not supported\n" , __func__);return ; } - - lo->offset =layout_end (seg); + end = seg->offset; }layout_update_len (lo, end);
Signature · 1 line
2.3.3
Looks good,
Guess we need some good testcase for these artifical partial segment returns that don't happen with the real client..
Quoted 6 lines · Christoph Hellwig
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>Guess we need some good testcase for these artifical partial segment returns that don't happen with the real client..
pynfs might do it? But I'm not volunteering.
Anyway, applying these three for 4.0. (NFSD: Printk blocklayout length a.., NFSD: Take care the return value.., NFSD: Fix bad update of layout in...).
--b.