From patchwork Tue Feb 22 23:56:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 582551 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1MNu7pB000564 for ; Tue, 22 Feb 2011 23:56:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808Ab1BVX4F (ORCPT ); Tue, 22 Feb 2011 18:56:05 -0500 Received: from daytona.panasas.com ([67.152.220.89]:29833 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751697Ab1BVX4F (ORCPT ); Tue, 22 Feb 2011 18:56:05 -0500 Received: from lt.bhalevy.com.com ([172.17.142.144]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Feb 2011 18:56:03 -0500 From: Benny Halevy To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH] NFSv4.1: reject zero layout with zeroed stripe unit Date: Tue, 22 Feb 2011 15:56:01 -0800 Message-Id: <1298418961-15667-1-git-send-email-bhalevy@panasas.com> X-Mailer: git-send-email 1.7.3.4 X-OriginalArrivalTime: 22 Feb 2011 23:56:03.0925 (UTC) FILETIME=[10635050:01CBD2EC] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Feb 2011 23:56:07 +0000 (UTC) diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 23f930c..3982665 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -92,8 +92,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; }