aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2011-02-22 18:56:01 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:45 -0500
commit75247affd7930cc3dcf57f850f0d7898379ef3b3 (patch)
treeb0a9f986d5d209d4ab422525a16cfdc38da917da /fs/nfs/nfs4filelayout.c
parent36fe432d33e078caee5c954e15e929819c2cacae (diff)
NFSv4.1: reject zero layout with zeroed stripe unit
Allowing stripe_unit==0 causes the client to crash later on when dividing by zero. Reported-by: Marc Eshel <eshel@almaden.ibm.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 7e1d4571b7b2..428558464817 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -369,8 +369,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
369 goto out; 369 goto out;
370 } 370 }
371 371
372 if (fl->stripe_unit % PAGE_SIZE) { 372 if (!fl->stripe_unit || fl->stripe_unit % PAGE_SIZE) {
373 dprintk("%s Stripe unit (%u) not page aligned\n", 373 dprintk("%s Invalid stripe unit (%u)\n",
374 __func__, fl->stripe_unit); 374 __func__, fl->stripe_unit);
375 goto out; 375 goto out;
376 } 376 }