From: Changheun Lee <nanich.lee@samsung.com>
To: damien.lemoal@wdc.com
Cc: Johannes.Thumshirn@wdc.com, asml.silence@gmail.com,
axboe@kernel.dk, jisoo2146.oh@samsung.com,
junho89.kim@samsung.com, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, ming.lei@redhat.com,
mj0123.lee@samsung.com, nanich.lee@samsung.com, osandov@fb.com,
patchwork-bot@kernel.org, seunghwan.hyun@samsung.com,
sookwan7.kim@samsung.com, tj@kernel.org, tom.leiming@gmail.com,
woosung2.lee@samsung.com, yt0928.kim@samsung.com
Subject: Re: [PATCH v3 1/2] bio: limit bio max size
Date: Wed, 27 Jan 2021 14:22:57 +0900 [thread overview]
Message-ID: <20210127052257.13186-1-nanich.lee@samsung.com> (raw)
In-Reply-To: <BL0PR04MB6514D7392DB2F6B9069A4B7FE7BB9@BL0PR04MB6514.namprd04.prod.outlook.com>
> On 2021/01/27 9:36, Changheun Lee wrote:
> >>> +
> >>> /**
> >>> * bio_reset - reinitialize a bio
> >>> * @bio: bio to reset
> >>> @@ -877,7 +892,7 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page,
> >>> struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1];
> >>>
> >>> if (page_is_mergeable(bv, page, len, off, same_page)) {
> >>> - if (bio->bi_iter.bi_size > UINT_MAX - len) {
> >>> + if (bio->bi_iter.bi_size > bio_max_size(bio) - len) {
> >>> *same_page = false;
> >>> return false;
> >>> }
> >>> diff --git a/include/linux/bio.h b/include/linux/bio.h
> >>> index 1edda614f7ce..cdb134ca7bf5 100644
> >>> --- a/include/linux/bio.h
> >>> +++ b/include/linux/bio.h
> >>> @@ -100,6 +100,8 @@ static inline void *bio_data(struct bio *bio)
> >>> return NULL;
> >>> }
> >>>
> >>> +extern unsigned int bio_max_size(struct bio *);
> >>
> >> No need for extern.
> >
> > It's just for compile warning in my test environment.
> > I'll remove it too. But I think compile warning could be in the other
> > .c file which includes bio.h. Is it OK?
>
> Hmmm... not having extern should not generate a compilation warning. There are
> tons of functions declared without extern in header files in the kernel. What
> compiler are you using ?
>
Compiler imformation is below.
CROSS_COMPILE: android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
CC: android/prebuilts/clang/host/linux-x86/clang-r383902/bin/clang
CLANG_TRIPLE: android/prebuilts/clang/host/linux-x86/clang-r383902/bin/aarch64-linux-gnu-
CROSS_COMPILE_COMPAT: android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-
>
> --
> Damien Le Moal
> Western Digital Research
>
---
Changheun Lee
Samsung Electronics
next prev parent reply other threads:[~2021-01-27 6:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210126093706epcas1p150e9b57a678f8724fa8ab9eddcec8a42@epcas1p1.samsung.com>
2021-01-26 9:21 ` [PATCH v3 1/2] bio: limit bio max size Changheun Lee
2021-01-26 10:28 ` Damien Le Moal
[not found] ` <CGME20210127003642epcas1p4f167d553fc79ef5029a928550adbebea@epcas1p4.samsung.com>
2021-01-27 0:21 ` Changheun Lee
2021-01-27 1:03 ` Damien Le Moal
[not found] ` <CGME20210127053827epcas1p1e0cda00cdbfdacd5a3ede69c788d6710@epcas1p1.samsung.com>
2021-01-27 5:22 ` Changheun Lee [this message]
[not found] <CGME20210126014805epcas1p2c4fc40f01c9c89b0a94ff6cac5408347@epcas1p2.samsung.com>
2021-01-26 1:32 ` Changheun Lee
2021-01-26 3:57 ` Ming Lei
2021-01-26 4:06 ` Damien Le Moal
2021-01-26 6:07 ` Ming Lei
2021-01-26 6:26 ` Damien Le Moal
2021-01-26 11:54 ` Ming Lei
[not found] ` <CGME20210127005900epcas1p2456b0f3321b404995445b8654468c30e@epcas1p2.samsung.com>
2021-01-27 0:43 ` Changheun Lee
2021-01-26 15:05 ` Christoph Hellwig
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=20210127052257.13186-1-nanich.lee@samsung.com \
--to=nanich.lee@samsung.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=jisoo2146.oh@samsung.com \
--cc=junho89.kim@samsung.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=mj0123.lee@samsung.com \
--cc=osandov@fb.com \
--cc=patchwork-bot@kernel.org \
--cc=seunghwan.hyun@samsung.com \
--cc=sookwan7.kim@samsung.com \
--cc=tj@kernel.org \
--cc=tom.leiming@gmail.com \
--cc=woosung2.lee@samsung.com \
--cc=yt0928.kim@samsung.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).