diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2016-11-08 01:32:00 +0100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-11-08 01:32:00 +0100 |
commit | aada54f9800497cc8249c99ffcb1431c6d8e98e7 (patch) | |
tree | ed1e57857d1a6a0d6c3b16e42e8492b95ecf4613 | |
parent | dax: make 'wait_table' global variable static (diff) | |
download | linux-aada54f9800497cc8249c99ffcb1431c6d8e98e7.tar.xz linux-aada54f9800497cc8249c99ffcb1431c6d8e98e7.zip |
dax: remove the last BUG_ON() from fs/dax.c
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>
Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r-- | fs/dax.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |