Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}