block/blk-core.c | 7 +++++++ include/linux/blkdev.h | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-)
blk_flush_plug() can be used in a filesystem module, without it may cause
a link failure, as shown in the reported test.
ERROR: modpost: "__blk_flush_plug" [fs/f2fs/f2fs.ko] undefined!
Export the symbol so it can be used by filesystem module.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309021523.UcS7T7mp-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202309021427.K1P8kWbl-lkp@intel.com/
Fixes: e1e9b8062c74 ("f2fs: replace blk_finish_plug() with blk_flush_plug()")
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
block/blk-core.c | 7 +++++++
include/linux/blkdev.h | 8 +-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 99d8b9812b18..1c5e5d3406fe 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1156,6 +1156,13 @@ void __blk_flush_plug(struct blk_plug *plug, bool from_schedule)
blk_mq_free_plug_rqs(plug);
}
+void blk_flush_plug(struct blk_plug *plug, bool async)
+{
+ if (plug)
+ __blk_flush_plug(plug, async);
+}
+EXPORT_SYMBOL(blk_flush_plug);
+
/**
* blk_finish_plug - mark the end of a batch of submitted I/O
* @plug: The &struct blk_plug passed to blk_start_plug()
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ed44a997f629..26ff9d417e6e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -986,13 +986,7 @@ extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug,
extern void blk_start_plug(struct blk_plug *);
extern void blk_start_plug_nr_ios(struct blk_plug *, unsigned short);
extern void blk_finish_plug(struct blk_plug *);
-
-void __blk_flush_plug(struct blk_plug *plug, bool from_schedule);
-static inline void blk_flush_plug(struct blk_plug *plug, bool async)
-{
- if (plug)
- __blk_flush_plug(plug, async);
-}
+extern void blk_flush_plug(struct blk_plug *plug, bool async);
int blkdev_issue_flush(struct block_device *bdev);
long nr_blockdev_pages(void);
--
2.25.1
On Sun, Sep 03, 2023 at 10:22:43PM -0600, Chunhai Guo wrote: > blk_flush_plug() can be used in a filesystem module, without it may cause > a link failure, as shown in the reported test. It should not be used by a file system, so please revert the change that started using it despite it intentionally not being exported.
在 2023/9/4 14:15, Christoph Hellwig 写道: > [????????? hch@infradead.org ????????? https://aka.ms/LearnAboutSenderIdentification?????????????] > > On Sun, Sep 03, 2023 at 10:22:43PM -0600, Chunhai Guo wrote: >> blk_flush_plug() can be used in a filesystem module, without it may cause >> a link failure, as shown in the reported test. > > It should not be used by a file system, so please revert the change that > started using it despite it intentionally not being exported. > Hi Christoph, Could you please detail why blk_flush_plug() can not be used by a file system? Thanks.
On Mon, Sep 04, 2023 at 03:24:10PM +0800, Chunhai Guo wrote: > Could you please detail why blk_flush_plug() can not be used by a file > system? Can you detail why it is a good idea to use it? Beause you nee to make the argument why something should be exported.
在 2023/9/4 15:34, Christoph Hellwig 写道:
> [????????? hch@infradead.org ????????? https://aka.ms/LearnAboutSenderIdentification?????????????]
>
> On Mon, Sep 04, 2023 at 03:24:10PM +0800, Chunhai Guo wrote:
>> Could you please detail why blk_flush_plug() can not be used by a file
>> system?
>
> Can you detail why it is a good idea to use it? Beause you nee to make
> the argument why something should be exported.
Hi Christoph,
Got it. This could be a topic too big to discuss here.
Thanks.
Hi Jaegeuk,
As per Christoph's suggestion, could you please assist with reverting
the commit e1e9b8062c74 ("f2fs: replace blk_finish_plug() with
blk_flush_plug()")?
Thanks.
© 2016 - 2025 Red Hat, Inc.