Linux-Next Archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Christian Brauner <brauner@kernel.org>, David Sterba <dsterba@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	David Sterba <dsterba@suse.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: linux-next: manual merge of the vfs-brauner tree with the btrfs tree
Date: Fri, 3 May 2024 11:00:01 +1000	[thread overview]
Message-ID: <20240503110001.336f3286@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2819 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/disk-io.c

between commits:

  4a63bd0ffbd2 ("btrfs: convert super block writes to folio in wait_dev_supers()")
  545799bb1bb9 ("btrfs: count super block write errors in device instead of tracking folio error state")

from the btrfs tree and commit:

  db3102368e1b ("use ->bd_mapping instead of ->bd_inode->i_mapping")

from the vfs-brauner tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index e8aca9f0e692,f10e894b0bf5..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -3739,9 -3738,10 +3739,9 @@@ static int write_dev_supers(struct btrf
  			    struct btrfs_super_block *sb, int max_mirrors)
  {
  	struct btrfs_fs_info *fs_info = device->fs_info;
- 	struct address_space *mapping = device->bdev->bd_inode->i_mapping;
+ 	struct address_space *mapping = device->bdev->bd_mapping;
  	SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
  	int i;
 -	int errors = 0;
  	int ret;
  	u64 bytenr, bytenr_orig;
  
@@@ -3857,21 -3855,30 +3857,21 @@@ static int wait_dev_supers(struct btrfs
  		    device->commit_total_bytes)
  			break;
  
- 		folio = filemap_get_folio(device->bdev->bd_inode->i_mapping,
 -		page = find_get_page(device->bdev->bd_mapping,
 -				     bytenr >> PAGE_SHIFT);
 -		if (!page) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
++		folio = filemap_get_folio(device->bdev->bd_mapping,
 +					  bytenr >> PAGE_SHIFT);
 +		/* If the folio has been removed, then we know it completed. */
 +		if (IS_ERR(folio))
  			continue;
 -		}
 -		/* Page is submitted locked and unlocked once the IO completes */
 -		wait_on_page_locked(page);
 -		if (PageError(page)) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
 -		}
 +		ASSERT(folio_order(folio) == 0);
  
 -		/* Drop our reference */
 -		put_page(page);
 -
 -		/* Drop the reference from the writing run */
 -		put_page(page);
 +		/* Folio will be unlocked once the write completes. */
 +		folio_wait_locked(folio);
 +		folio_put(folio);
  	}
  
 -	/* log error, force error return */
 +	errors += atomic_read(&device->sb_write_errors);
 +	if (errors >= BTRFS_SUPER_PRIMARY_WRITE_ERROR)
 +		primary_failed = true;
  	if (primary_failed) {
  		btrfs_err(device->fs_info, "error writing primary super block to device %llu",
  			  device->devid);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2024-05-03  1:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  1:00 Stephen Rothwell [this message]
2024-05-14  1:38 ` linux-next: manual merge of the vfs-brauner tree with the btrfs tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2024-04-30 23:42 Stephen Rothwell
2023-12-06 23:32 Stephen Rothwell
2024-01-08 20:56 ` Stephen Rothwell
2023-11-26 22:20 Stephen Rothwell
2023-11-28 21:33 ` Nathan Chancellor
2023-11-29 11:09   ` Jan Kara
2023-11-29 20:50     ` Stephen Rothwell
2024-01-08 20:53       ` Stephen Rothwell
2023-11-26 22:14 Stephen Rothwell
2023-10-08 23:48 Stephen Rothwell
2023-10-09 16:15 ` Christian Brauner
2023-10-10 21:37   ` Stephen Rothwell
2023-10-11  0:24     ` Stephen Rothwell
2023-10-11  9:20     ` David Sterba
2023-10-12 15:42       ` David Sterba
2023-10-23 17:55         ` David Sterba
2023-10-23 21:25           ` Stephen Rothwell
2023-10-24 15:32             ` David Sterba
2023-10-25  0:09               ` Stephen Rothwell
2023-08-15  1:20 Stephen Rothwell

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=20240503110001.336f3286@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=brauner@kernel.org \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).