Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513478 > unrolled thread

[PATCH v9 05/16] dax: remove the last BUG_ON() from fs/dax.c

Started byRoss Zwisler <ross.zwisler@linux.intel.com>
First post2016-11-01 21:10 +0100
Last post2016-11-01 21:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v9 05/16] dax: remove the last BUG_ON() from fs/dax.c Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-11-01 21:10 +0100

#1513478 — [PATCH v9 05/16] dax: remove the last BUG_ON() from fs/dax.c

FromRoss Zwisler <ross.zwisler@linux.intel.com>
Date2016-11-01 21:10 +0100
Subject[PATCH v9 05/16] dax: remove the last BUG_ON() from fs/dax.c
Message-ID<syNxE-4RO-29@gated-at.bofh.it>
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 <ross.zwisler@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/dax.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/dax.c b/fs/dax.c
index e52e754..219fa2b 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web