Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253932
b: refs/heads/master
c: cec765c
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Jun 15, 2011
1 parent a4e623c commit 39738d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 533eb4611c9eea53072eb6a61d5a6393b6a77ed7
refs/heads/master: cec765cf5891c7fc3d905832b481bfb6fd55825d
15 changes: 10 additions & 5 deletions trunk/fs/nfs/nfs4filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,18 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
__func__, nfl_util, fl->num_fh, fl->first_stripe_index,
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;

fl->fh_array = kzalloc(fl->num_fh * sizeof(struct nfs_fh *),
gfp_flags);
if (!fl->fh_array)
goto out_err;
if (fl->num_fh > 0) {
fl->fh_array = kzalloc(fl->num_fh * sizeof(struct nfs_fh *),
gfp_flags);
if (!fl->fh_array)
goto out_err;
}

for (i = 0; i < fl->num_fh; i++) {
/* Do we want to use a mempool here? */
Expand Down

0 comments on commit 39738d9

Please sign in to comment.