linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>,
	Jens Axboe <axboe@kernel.dk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the ext4 tree with Linus' tree
Date: Fri, 18 Dec 2020 10:12:49 +1100	[thread overview]
Message-ID: <20201218101249.20f29765@canb.auug.org.au> (raw)

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

Hi all,

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

  fs/ext4/super.c

between commit:

  8446fe9255be ("block: switch partition lookup to use struct block_device")

from Linus' tree and commit:

  8e6f04c5e918 ("ext4: use sbi instead of EXT4_SB(sb) in ext4_update_super()")

from the ext4 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/ext4/super.c
index 830c196ec069,f53e69ec858d..000000000000
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@@ -5499,22 -5493,76 +5487,72 @@@ static void ext4_update_super(struct su
  	 */
  	if (!(sb->s_flags & SB_RDONLY))
  		ext4_update_tstamp(es, s_wtime);
 -	if (sb->s_bdev->bd_part)
 -		es->s_kbytes_written =
 -			cpu_to_le64(sbi->s_kbytes_written +
 -			    ((part_stat_read(sb->s_bdev->bd_part,
 -					     sectors[STAT_WRITE]) -
 -			      sbi->s_sectors_written_start) >> 1));
 -	else
 -		es->s_kbytes_written = cpu_to_le64(sbi->s_kbytes_written);
 +	es->s_kbytes_written =
- 		cpu_to_le64(EXT4_SB(sb)->s_kbytes_written +
++		cpu_to_le64(sbi->s_kbytes_written +
 +		    ((part_stat_read(sb->s_bdev, sectors[STAT_WRITE]) -
- 		      EXT4_SB(sb)->s_sectors_written_start) >> 1));
- 	if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
++		      sbi->s_sectors_written_start) >> 1));
+ 	if (percpu_counter_initialized(&sbi->s_freeclusters_counter))
  		ext4_free_blocks_count_set(es,
- 			EXT4_C2B(EXT4_SB(sb), percpu_counter_sum_positive(
- 				&EXT4_SB(sb)->s_freeclusters_counter)));
- 	if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeinodes_counter))
+ 			EXT4_C2B(sbi, percpu_counter_sum_positive(
+ 				&sbi->s_freeclusters_counter)));
+ 	if (percpu_counter_initialized(&sbi->s_freeinodes_counter))
  		es->s_free_inodes_count =
  			cpu_to_le32(percpu_counter_sum_positive(
- 				&EXT4_SB(sb)->s_freeinodes_counter));
- 	BUFFER_TRACE(sbh, "marking dirty");
+ 				&sbi->s_freeinodes_counter));
+ 	/* Copy error information to the on-disk superblock */
+ 	spin_lock(&sbi->s_error_lock);
+ 	if (sbi->s_add_error_count > 0) {
+ 		es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
+ 		if (!es->s_first_error_time && !es->s_first_error_time_hi) {
+ 			__ext4_update_tstamp(&es->s_first_error_time,
+ 					     &es->s_first_error_time_hi,
+ 					     sbi->s_first_error_time);
+ 			strncpy(es->s_first_error_func, sbi->s_first_error_func,
+ 				sizeof(es->s_first_error_func));
+ 			es->s_first_error_line =
+ 				cpu_to_le32(sbi->s_first_error_line);
+ 			es->s_first_error_ino =
+ 				cpu_to_le32(sbi->s_first_error_ino);
+ 			es->s_first_error_block =
+ 				cpu_to_le64(sbi->s_first_error_block);
+ 			es->s_first_error_errcode =
+ 				ext4_errno_to_code(sbi->s_first_error_code);
+ 		}
+ 		__ext4_update_tstamp(&es->s_last_error_time,
+ 				     &es->s_last_error_time_hi,
+ 				     sbi->s_last_error_time);
+ 		strncpy(es->s_last_error_func, sbi->s_last_error_func,
+ 			sizeof(es->s_last_error_func));
+ 		es->s_last_error_line = cpu_to_le32(sbi->s_last_error_line);
+ 		es->s_last_error_ino = cpu_to_le32(sbi->s_last_error_ino);
+ 		es->s_last_error_block = cpu_to_le64(sbi->s_last_error_block);
+ 		es->s_last_error_errcode =
+ 				ext4_errno_to_code(sbi->s_last_error_code);
+ 		/*
+ 		 * Start the daily error reporting function if it hasn't been
+ 		 * started already
+ 		 */
+ 		if (!es->s_error_count)
+ 			mod_timer(&sbi->s_err_report, jiffies + 24*60*60*HZ);
+ 		le32_add_cpu(&es->s_error_count, sbi->s_add_error_count);
+ 		sbi->s_add_error_count = 0;
+ 	}
+ 	spin_unlock(&sbi->s_error_lock);
+ 
  	ext4_superblock_csum_set(sb);
- 	if (sync)
- 		lock_buffer(sbh);
+ 	unlock_buffer(sbh);
+ }
+ 
+ static int ext4_commit_super(struct super_block *sb)
+ {
+ 	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
+ 	int error = 0;
+ 
+ 	if (!sbh || block_device_ejected(sb))
+ 		return error;
+ 
+ 	ext4_update_super(sb);
+ 
  	if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) {
  		/*
  		 * Oh, dear.  A previous attempt to write the

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

             reply	other threads:[~2020-12-17 23:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 23:12 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-06-27  0:39 linux-next: manual merge of the ext4 tree with Linus' tree Stephen Rothwell
2023-06-27  6:37 ` Christoph Hellwig
2023-06-27  7:26   ` Stephen Rothwell
2021-06-07  0:27 Stephen Rothwell
2020-10-20 23:03 Stephen Rothwell
2019-09-19 11:44 Mark Brown
2016-03-21  0:29 Stephen Rothwell
2013-08-13  1:33 Stephen Rothwell
2011-03-25  1:56 Stephen Rothwell
2011-03-25 14:45 ` Tejun Heo
2011-03-25 16:30   ` Sedat Dilek
2011-03-25 19:58   ` Ted Ts'o
2011-02-14  2:19 Stephen Rothwell
2010-10-28  0:45 Stephen Rothwell
2010-05-22  5:50 Stephen Rothwell
2009-09-17  1:56 linux-next: manual merge of the ext4 tree with Linus tree Stephen Rothwell
2009-09-17 13:22 ` Theodore Tso
2009-09-17 13:30   ` Stephen Rothwell
2009-02-02  2:56 linux-next: manual merge of the ext4 tree with Linus' tree 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=20201218101249.20f29765@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).