Commit 75247aff authored by Benny Halevy's avatar Benny Halevy Committed by Trond Myklebust

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: default avatarMarc Eshel <eshel@almaden.ibm.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 36fe432d
...@@ -369,8 +369,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo, ...@@ -369,8 +369,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
goto out; goto out;
} }
if (fl->stripe_unit % PAGE_SIZE) { if (!fl->stripe_unit || fl->stripe_unit % PAGE_SIZE) {
dprintk("%s Stripe unit (%u) not page aligned\n", dprintk("%s Invalid stripe unit (%u)\n",
__func__, fl->stripe_unit); __func__, fl->stripe_unit);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment