From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 646CB6B0253 for ; Tue, 11 Oct 2016 14:42:32 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id f193so502020wmg.2 for ; Tue, 11 Oct 2016 11:42:32 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id p204si145885wmd.107.2016.10.11.11.42.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 11 Oct 2016 11:42:30 -0700 (PDT) Date: Tue, 11 Oct 2016 08:50:01 +0200 From: Jan Kara Subject: Re: [PATCH v5 07/17] dax: remove the last BUG_ON() from fs/dax.c Message-ID: <20161011065001.GB6952@quack2.suse.cz> References: <1475874544-24842-1-git-send-email-ross.zwisler@linux.intel.com> <1475874544-24842-8-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475874544-24842-8-git-send-email-ross.zwisler@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.org On Fri 07-10-16 15:08:54, Ross Zwisler wrote: > Don't take down the kernel if we get an invalid 'from' and 'length' > argument pair. Just warn once and return an error. > > Signed-off-by: Ross Zwisler Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > fs/dax.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/dax.c b/fs/dax.c > index ac28cdf..98189ac 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -1194,7 +1194,8 @@ int dax_zero_page_range(struct inode *inode, loff_t from, unsigned length, > /* Block boundary? Nothing to do */ > if (!length) > return 0; > - BUG_ON((offset + length) > PAGE_SIZE); > + if (WARN_ON_ONCE((offset + length) > PAGE_SIZE)) > + return -EINVAL; > > memset(&bh, 0, sizeof(bh)); > bh.b_bdev = inode->i_sb->s_bdev; > -- > 2.7.4 > > -- Jan Kara SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org