linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 08/17] f2fs: remove FAULT_ALLOC_BIO
Date: Thu, 28 Jan 2021 10:45:59 +0800	[thread overview]
Message-ID: <9625b1bb-e87a-d46b-b934-a017f23f80f4@huawei.com> (raw)
In-Reply-To: <20210126145247.1964410-9-hch@lst.de>

Jaegeuk,

I remember that you concerned about backport issue of bio fault injection
entry removal? IIRC.

If you have no objection on this now, let me Ack f2fs part change on this
series.

Thanks,

On 2021/1/26 22:52, Christoph Hellwig wrote:
> Sleeping bio allocations do not fail, which means that injecting an error
> into sleeping bio allocations is a little silly.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   Documentation/filesystems/f2fs.rst |  1 -
>   fs/f2fs/data.c                     | 29 ++++-------------------------
>   fs/f2fs/f2fs.h                     |  1 -
>   fs/f2fs/super.c                    |  1 -
>   4 files changed, 4 insertions(+), 28 deletions(-)
> 
> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
> index dae15c96e659e2..624f5f3ed93e86 100644
> --- a/Documentation/filesystems/f2fs.rst
> +++ b/Documentation/filesystems/f2fs.rst
> @@ -179,7 +179,6 @@ fault_type=%d		 Support configuring fault injection type, should be
>   			 FAULT_KVMALLOC		  0x000000002
>   			 FAULT_PAGE_ALLOC	  0x000000004
>   			 FAULT_PAGE_GET		  0x000000008
> -			 FAULT_ALLOC_BIO	  0x000000010
>   			 FAULT_ALLOC_NID	  0x000000020
>   			 FAULT_ORPHAN		  0x000000040
>   			 FAULT_BLOCK		  0x000000080
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 0cf0c605992431..9fb6be65592b1f 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -50,28 +50,6 @@ void f2fs_destroy_bioset(void)
>   	bioset_exit(&f2fs_bioset);
>   }
>   
> -static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask,
> -						unsigned int nr_iovecs)
> -{
> -	return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset);
> -}
> -
> -static struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages,
> -		bool noio)
> -{
> -	if (noio) {
> -		/* No failure on bio allocation */
> -		return __f2fs_bio_alloc(GFP_NOIO, npages);
> -	}
> -
> -	if (time_to_inject(sbi, FAULT_ALLOC_BIO)) {
> -		f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO);
> -		return NULL;
> -	}
> -
> -	return __f2fs_bio_alloc(GFP_KERNEL, npages);
> -}
> -
>   static bool __is_cp_guaranteed(struct page *page)
>   {
>   	struct address_space *mapping = page->mapping;
> @@ -433,7 +411,7 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
>   	struct f2fs_sb_info *sbi = fio->sbi;
>   	struct bio *bio;
>   
> -	bio = f2fs_bio_alloc(sbi, npages, true);
> +	bio = bio_alloc_bioset(GFP_NOIO, npages, &f2fs_bioset);
>   
>   	f2fs_target_device(sbi, fio->new_blkaddr, bio);
>   	if (is_read_io(fio->op)) {
> @@ -1029,8 +1007,9 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
>   	struct bio_post_read_ctx *ctx;
>   	unsigned int post_read_steps = 0;
>   
> -	bio = f2fs_bio_alloc(sbi, min_t(int, nr_pages, BIO_MAX_PAGES),
> -								for_write);
> +	bio = bio_alloc_bioset(for_write ? GFP_NOIO : GFP_KERNEL,
> +			       min_t(int, nr_pages, BIO_MAX_PAGES),
> +			       &f2fs_bioset);
>   	if (!bio)
>   		return ERR_PTR(-ENOMEM);
>   
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 902bd3267c03e1..6c78365d80ceb5 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -43,7 +43,6 @@ enum {
>   	FAULT_KVMALLOC,
>   	FAULT_PAGE_ALLOC,
>   	FAULT_PAGE_GET,
> -	FAULT_ALLOC_BIO,
>   	FAULT_ALLOC_NID,
>   	FAULT_ORPHAN,
>   	FAULT_BLOCK,
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index b4a07fe62d1a58..3a312642907e86 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -45,7 +45,6 @@ const char *f2fs_fault_name[FAULT_MAX] = {
>   	[FAULT_KVMALLOC]	= "kvmalloc",
>   	[FAULT_PAGE_ALLOC]	= "page alloc",
>   	[FAULT_PAGE_GET]	= "page get",
> -	[FAULT_ALLOC_BIO]	= "alloc bio",
>   	[FAULT_ALLOC_NID]	= "alloc nid",
>   	[FAULT_ORPHAN]		= "orphan",
>   	[FAULT_BLOCK]		= "no more block",
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2021-01-28  2:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 14:52 [f2fs-dev] misc bio allocation cleanups Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 01/17] zonefs: use bio_alloc in zonefs_file_dio_append Christoph Hellwig
2021-01-26 15:08   ` Johannes Thumshirn
2021-01-26 19:09   ` Chaitanya Kulkarni
2021-01-26 23:23   ` [f2fs-dev] [dm-devel] " Damien Le Moal
2021-01-26 14:52 ` [f2fs-dev] [PATCH 02/17] btrfs: use bio_kmalloc in __alloc_device Christoph Hellwig
2021-01-26 15:01   ` Josef Bacik
2021-01-26 19:11   ` Chaitanya Kulkarni
2021-01-26 14:52 ` [f2fs-dev] [PATCH 03/17] blk-crypto: use bio_kmalloc in blk_crypto_clone_bio Christoph Hellwig
2021-01-26 21:51   ` Eric Biggers
2021-01-26 14:52 ` [f2fs-dev] [PATCH 04/17] block: split bio_kmalloc from bio_alloc_bioset Christoph Hellwig
2021-01-30  3:56   ` Matthew Wilcox
2021-02-01 12:22     ` Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 05/17] block: use an on-stack bio in blkdev_issue_flush Christoph Hellwig
2021-01-26 19:15   ` Chaitanya Kulkarni
2021-01-26 14:52 ` [f2fs-dev] [PATCH 06/17] dm-clone: use blkdev_issue_flush in commit_metadata Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 07/17] f2fs: use blkdev_issue_flush in __submit_flush_wait Christoph Hellwig
2021-01-29  1:03   ` Chao Yu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 08/17] f2fs: remove FAULT_ALLOC_BIO Christoph Hellwig
2021-01-28  2:45   ` Chao Yu [this message]
2021-01-28 16:11   ` Jaegeuk Kim
2021-01-29  1:04   ` Chao Yu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 09/17] drbd: remove bio_alloc_drbd Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 10/17] drbd: remove drbd_req_make_private_bio Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 11/17] md: remove bio_alloc_mddev Christoph Hellwig
2021-01-27  7:21   ` Song Liu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 12/17] md: simplify sync_page_io Christoph Hellwig
2021-01-27  7:22   ` Song Liu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 13/17] md: remove md_bio_alloc_sync Christoph Hellwig
2021-01-27  7:22   ` Song Liu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 14/17] md/raid6: refactor raid5_read_one_chunk Christoph Hellwig
2021-01-27  7:15   ` Song Liu
2021-01-26 14:52 ` [f2fs-dev] [PATCH 15/17] nfs/blocklayout: remove cruft in bl_alloc_init_bio Christoph Hellwig
2021-01-26 14:52 ` [f2fs-dev] [PATCH 16/17] nilfs2: remove cruft in nilfs_alloc_seg_bio Christoph Hellwig
2021-01-26 19:17   ` Chaitanya Kulkarni
2021-01-26 14:52 ` [f2fs-dev] [PATCH 17/17] mm: remove get_swap_bio Christoph Hellwig
2021-01-27 16:52 ` [f2fs-dev] misc bio allocation cleanups Jens Axboe
2021-02-01  1:16 ` Guoqing Jiang

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=9625b1bb-e87a-d46b-b934-a017f23f80f4@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=jaegeuk@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 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).