From: Jeff Moyer <jmoyer@redhat.com>
To: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Matias Bjorling <m@bjorling.me>, Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
Yuanhan Liu <yuanhan.liu@linux.intel.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Jan Kara <jack@suse.cz>, Johannes Weiner <hannes@cmpxchg.org>,
Zhang Yanfei <zhangyanfei@cn.fujitsu.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Sumanth <sumantk2@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH] fs null_blk: Null pointer deference problem in alloc_page_buffers
Date: Fri, 17 Jan 2014 12:39:58 -0500 [thread overview]
Message-ID: <x49sismzevl.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1389950530-8903-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com> (Raghavendra K. T.'s message of "Fri, 17 Jan 2014 14:52:10 +0530")
Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> writes:
> diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
> index a2e69d2..6b0e049 100644
> --- a/drivers/block/null_blk.c
> +++ b/drivers/block/null_blk.c
> @@ -535,6 +535,11 @@ static int null_add_dev(void)
> if (!nullb)
> return -ENOMEM;
>
> + if (bs > PAGE_SIZE) {
> + WARN(1, "Invalid block size. Setting it to 4096\n");
> + bs = 4096;
> + }
> +
Why are you hard-coding 4k instead of just using PAGE_SIZE?
Cheers,
Jeff
next prev parent reply other threads:[~2014-01-17 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 9:22 [RFC PATCH] fs null_blk: Null pointer deference problem in alloc_page_buffers Raghavendra K T
2014-01-17 17:39 ` Jeff Moyer [this message]
2014-01-17 18:35 ` Raghavendra K T
2014-01-17 18:26 ` Matias Bjorling
2014-01-17 18:48 ` Raghavendra K T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x49sismzevl.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=darrick.wong@oracle.com \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m@bjorling.me \
--cc=raghavendra.kt@linux.vnet.ibm.com \
--cc=sumantk2@linux.vnet.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=yuanhan.liu@linux.intel.com \
--cc=zhangyanfei@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).