mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 08:18:47 +00:00
NFSv4.1: allow zero fh array in filelayout decode layout
Signed-off-by: Andy Adamson <andros@netapp.com> cc:stable@kernel.org [2.6.39] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
533eb4611c
commit
cec765cf58
@ -552,13 +552,18 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
|
|||||||
__func__, nfl_util, fl->num_fh, fl->first_stripe_index,
|
__func__, nfl_util, fl->num_fh, fl->first_stripe_index,
|
||||||
fl->pattern_offset);
|
fl->pattern_offset);
|
||||||
|
|
||||||
if (!fl->num_fh)
|
/* Note that a zero value for num_fh is legal for STRIPE_SPARSE.
|
||||||
|
* Futher checking is done in filelayout_check_layout */
|
||||||
|
if (fl->num_fh < 0 || fl->num_fh >
|
||||||
|
max(NFS4_PNFS_MAX_STRIPE_CNT, NFS4_PNFS_MAX_MULTI_CNT))
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
fl->fh_array = kzalloc(fl->num_fh * sizeof(struct nfs_fh *),
|
if (fl->num_fh > 0) {
|
||||||
gfp_flags);
|
fl->fh_array = kzalloc(fl->num_fh * sizeof(struct nfs_fh *),
|
||||||
if (!fl->fh_array)
|
gfp_flags);
|
||||||
goto out_err;
|
if (!fl->fh_array)
|
||||||
|
goto out_err;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < fl->num_fh; i++) {
|
for (i = 0; i < fl->num_fh; i++) {
|
||||||
/* Do we want to use a mempool here? */
|
/* Do we want to use a mempool here? */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user