提交 75247aff 编写于 作者: B Benny Halevy 提交者: 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: NMarc Eshel <eshel@almaden.ibm.com>
Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 36fe432d
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册