From: Benny Halevy Date: Tue, 22 Feb 2011 23:56:01 +0000 (-0800) Subject: NFSv4.1: reject zero layout with zeroed stripe unit X-Git-Tag: v2.6.39-rc1~443^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75247affd7930cc3dcf57f850f0d7898379ef3b3;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: Benny Halevy Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 7e1d457..4285584 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -369,8 +369,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo, goto out; } - if (fl->stripe_unit % PAGE_SIZE) { - dprintk("%s Stripe unit (%u) not page aligned\n", + if (!fl->stripe_unit || fl->stripe_unit % PAGE_SIZE) { + dprintk("%s Invalid stripe unit (%u)\n", __func__, fl->stripe_unit); goto out; }