All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: kernel-janitors@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: don't allow negative ->write_io_size_bits
Date: Mon, 11 Feb 2019 18:45:14 +0000	[thread overview]
Message-ID: <20190211184514.GA22212@kadam> (raw)

We put an upper bound on ->write_io_size_bits but we don't have a lower
bound.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 3ec11d392a5e..2db2d38e2aca 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -586,7 +586,7 @@ static int parse_options(struct super_block *sb, char *options)
 		case Opt_io_size_bits:
 			if (args->from && match_int(args, &arg))
 				return -EINVAL;
-			if (arg > __ilog2_u32(BIO_MAX_PAGES)) {
+			if (arg < 0 || arg > __ilog2_u32(BIO_MAX_PAGES)) {
 				f2fs_msg(sb, KERN_WARNING,
 					"Not support %d, larger than %d",
 					1 << arg, BIO_MAX_PAGES);
-- 
2.17.1

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: kernel-janitors@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: don't allow negative ->write_io_size_bits
Date: Mon, 11 Feb 2019 21:45:14 +0300	[thread overview]
Message-ID: <20190211184514.GA22212@kadam> (raw)

We put an upper bound on ->write_io_size_bits but we don't have a lower
bound.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 3ec11d392a5e..2db2d38e2aca 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -586,7 +586,7 @@ static int parse_options(struct super_block *sb, char *options)
 		case Opt_io_size_bits:
 			if (args->from && match_int(args, &arg))
 				return -EINVAL;
-			if (arg > __ilog2_u32(BIO_MAX_PAGES)) {
+			if (arg < 0 || arg > __ilog2_u32(BIO_MAX_PAGES)) {
 				f2fs_msg(sb, KERN_WARNING,
 					"Not support %d, larger than %d",
 					1 << arg, BIO_MAX_PAGES);
-- 
2.17.1

             reply	other threads:[~2019-02-11 18:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 18:45 Dan Carpenter [this message]
2019-02-11 18:45 ` [PATCH] f2fs: don't allow negative ->write_io_size_bits Dan Carpenter
2019-02-13  3:32 ` Chao Yu
2019-02-13  3:32   ` Chao Yu
2019-02-13  8:49   ` [f2fs-dev] " Chao Yu
2019-02-13  8:49     ` Chao Yu
2019-02-13  9:46     ` [f2fs-dev] " Dan Carpenter
2019-02-13  9:46       ` Dan Carpenter
2019-02-14 16:09       ` [f2fs-dev] " Chao Yu
2019-02-14 16:09         ` Chao Yu
  -- strict thread matches above, loose matches on Subject: below --
2019-02-14 16:16 Chao Yu

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=20190211184514.GA22212@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.