[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYcZi5YYvt5QHrG9@casper.infradead.org>
Date: Sat, 23 Dec 2023 17:31:55 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, roger.pau@...rix.com, colyli@...e.de,
kent.overstreet@...il.com, joern@...ybastard.org,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
sth@...ux.ibm.com, hoeppner@...ux.ibm.com, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, clm@...com, josef@...icpanda.com,
dsterba@...e.com, viro@...iv.linux.org.uk, brauner@...nel.org,
nico@...xnic.net, xiang@...nel.org, chao@...nel.org, tytso@....edu,
adilger.kernel@...ger.ca, jack@...e.com, konishi.ryusuke@...il.com,
akpm@...ux-foundation.org, hare@...e.de, p.raghav@...sung.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-bcache@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-bcachefs@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-erofs@...ts.ozlabs.org, linux-ext4@...r.kernel.org,
linux-nilfs@...r.kernel.org, yukuai3@...wei.com,
yi.zhang@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH RFC v3 for-6.8/block 09/17] btrfs: use bdev apis
On Thu, Dec 21, 2023 at 04:57:04PM +0800, Yu Kuai wrote:
> @@ -3674,16 +3670,17 @@ struct btrfs_super_block *btrfs_read_dev_one_super(struct block_device *bdev,
> * Drop the page of the primary superblock, so later read will
> * always read from the device.
> */
> - invalidate_inode_pages2_range(mapping,
> - bytenr >> PAGE_SHIFT,
> + invalidate_bdev_range(bdev, bytenr >> PAGE_SHIFT,
> (bytenr + BTRFS_SUPER_INFO_SIZE) >> PAGE_SHIFT);
> }
>
> - page = read_cache_page_gfp(mapping, bytenr >> PAGE_SHIFT, GFP_NOFS);
> - if (IS_ERR(page))
> - return ERR_CAST(page);
> + nofs_flag = memalloc_nofs_save();
> + folio = bdev_read_folio(bdev, bytenr);
> + memalloc_nofs_restore(nofs_flag);
This is the wrong way to use memalloc_nofs_save/restore. They should be
used at the point that the filesystem takes/releases whatever lock is
also used during reclaim. I don't know btrfs well enough to suggest
what lock is missing these annotations.
Powered by blists - more mailing lists