f2fs: don't allow negative ->write_io_size_bits
Subsystems (2)
PATCH 1/1 f2fs: don't allow negative ->write_io_size_bits
We put an upper bound on ->write_io_size_bits but we don't have a lower bound.
--- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/super.c +1 -1
@@ -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 );
Signature · 1 line
2.17.1
Quoted 2 lines · Dan Carpenter
We put an upper bound on ->write_io_size_bits but we don't have a lower bound.
Oh, lower bound, I think there are more cases didn't consider that, let me check it.
Quoted 2 lines
Signed-off-by Dan Carpenter <[email protected]>
Thanks,
Quoted 6 lines · Chao Yu
Quoted 2 lines · Dan Carpenter
We put an upper bound on ->write_io_size_bits but we don't have a lower bound.
Oh, lower bound, I think there are more cases didn't consider that, let me check it.
Sorry, one missing case:
Shouldn't it be:
if (arg <= 0 || arg > __ilog2_u32(BIO_MAX_PAGES)) {
^Quoted 16 lines
Quoted 3 lines
Signed-off-by Dan Carpenter <[email protected]>Reviewed-by Chao Yu <[email protected]>Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 8 lines · Chao Yu
Quoted 6 lines · Chao Yu
Quoted 2 lines · Dan Carpenter
We put an upper bound on ->write_io_size_bits but we don't have a lower bound.
Oh, lower bound, I think there are more cases didn't consider that, let me check it.
Quoted 6 lines
Sorry, one missing case:
Shouldn't it be:
if (arg <= 0 || arg > __ilog2_u32(BIO_MAX_PAGES)) { ^
It wouldn't be hard for me to redo my patch, but I don't know enough to say if zero is invalid and I don't want to get blamed for that... Can you do it, since you're better able to test the change?
So let's drop this patch, and then could you give me Reported-by credit instead?
regards,
dan carpenter
Chao Yu
maintainerQuoted 16 lines · Dan Carpenter
Quoted 8 lines · Chao Yu
Quoted 6 lines · Chao Yu
Quoted 2 lines · Dan Carpenter
We put an upper bound on ->write_io_size_bits but we don't have a lower bound.
Oh, lower bound, I think there are more cases didn't consider that, let me check it.
Quoted 6 lines
Sorry, one missing case:
Shouldn't it be:
if (arg <= 0 || arg > __ilog2_u32(BIO_MAX_PAGES)) { ^
Quoted 6 lines
It wouldn't be hard for me to redo my patch, but I don't know enough to say if zero is invalid and I don't want to get blamed for that... Can you do it, since you're better able to test the change?
So let's drop this patch, and then could you give me Reported-by credit instead?
No problem. :)
Thanks,
Quoted 11 lines
regards,
dan carpenter_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel