linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the block tree with the ext4 tree
@ 2014-11-27  3:53 Stephen Rothwell
  2014-11-27  7:38 ` Christoph Hellwig
  2014-11-29 10:08 ` Sabrina Dubroca
  0 siblings, 2 replies; 15+ messages in thread
From: Stephen Rothwell @ 2014-11-27  3:53 UTC (permalink / raw)
  To: Jens Axboe, Theodore Ts'o; +Cc: linux-next, linux-kernel, Tejun Heo

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

Hi Jens,

Today's linux-next merge of the block tree got a conflict in
fs/fs-writeback.c between commit ef7fdf5e8c87 ("vfs: add support for a
lazytime mount option") from the ext4 tree and commit 9c6ac78eb352
("writeback: fix a subtle race condition in I_DIRTY clearing") from the
block tree.

I fixed it up (I took a guess, plese check - see below) and can carry
the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/fs-writeback.c
index 3d87174408ae,2d609a5fbfea..000000000000
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@@ -482,14 -479,30 +482,30 @@@ __writeback_single_inode(struct inode *
  	 * write_inode()
  	 */
  	spin_lock(&inode->i_lock);
- 	/* Clear I_DIRTY_PAGES if we've written out all dirty pages */
- 	if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
- 		inode->i_state &= ~I_DIRTY_PAGES;
+ 
 -	dirty = inode->i_state & I_DIRTY;
 -	inode->i_state &= ~I_DIRTY;
 +	dirty = inode->i_state & I_DIRTY_INODE;
 +	inode->i_state &= ~I_DIRTY_INODE;
+ 
+ 	/*
+ 	 * Paired with smp_mb() in __mark_inode_dirty().  This allows
+ 	 * __mark_inode_dirty() to test i_state without grabbing i_lock -
+ 	 * either they see the I_DIRTY bits cleared or we see the dirtied
+ 	 * inode.
+ 	 *
+ 	 * I_DIRTY_PAGES is always cleared together above even if @mapping
+ 	 * still has dirty pages.  The flag is reinstated after smp_mb() if
+ 	 * necessary.  This guarantees that either __mark_inode_dirty()
+ 	 * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY.
+ 	 */
+ 	smp_mb();
+ 
+ 	if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
+ 		inode->i_state |= I_DIRTY_PAGES;
+ 
  	spin_unlock(&inode->i_lock);
+ 
  	/* Don't write the inode if only I_DIRTY_PAGES was set */
 -	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
 +	if (dirty) {
  		int err = write_inode(inode, wbc);
  		if (ret == 0)
  			ret = err;

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2014-11-27  3:53 linux-next: manual merge of the block tree with the ext4 tree Stephen Rothwell
@ 2014-11-27  7:38 ` Christoph Hellwig
  2014-11-29 10:08 ` Sabrina Dubroca
  1 sibling, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2014-11-27  7:38 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, Theodore Ts'o, linux-next, linux-kernel,
	Tejun Heo, linux-fsdevel

On Thu, Nov 27, 2014 at 02:53:47PM +1100, Stephen Rothwell wrote:
> Hi Jens,
> 
> Today's linux-next merge of the block tree got a conflict in
> fs/fs-writeback.c between commit ef7fdf5e8c87 ("vfs: add support for a
> lazytime mount option")

Mergign that into a branch for linux-next must surely have been a
mistake, as the code isn't anywhere near ready.

I also think it very much should go into through the vfs tree.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2014-11-27  3:53 linux-next: manual merge of the block tree with the ext4 tree Stephen Rothwell
  2014-11-27  7:38 ` Christoph Hellwig
@ 2014-11-29 10:08 ` Sabrina Dubroca
  2014-11-29 17:38   ` Theodore Ts'o
  2014-11-29 22:08   ` Jeremiah Mahler
  1 sibling, 2 replies; 15+ messages in thread
From: Sabrina Dubroca @ 2014-11-29 10:08 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, Theodore Ts'o, linux-next, linux-kernel,
	Tejun Heo, Jeremiah Mahler

Hello,

[adding Jeremiah Mahler to CC]

2014-11-27, 14:53:47 +1100, Stephen Rothwell wrote:
> Hi Jens,
> 
> Today's linux-next merge of the block tree got a conflict in
> fs/fs-writeback.c between commit ef7fdf5e8c87 ("vfs: add support for a
> lazytime mount option") from the ext4 tree and commit 9c6ac78eb352
> ("writeback: fix a subtle race condition in I_DIRTY clearing") from the
> block tree.
> 
> I fixed it up (I took a guess, plese check - see below) and can carry
> the fix as necessary (no action is required).
> 
> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> 
> diff --cc fs/fs-writeback.c
> index 3d87174408ae,2d609a5fbfea..000000000000
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@@ -482,14 -479,30 +482,30 @@@ __writeback_single_inode(struct inode *
>   	 * write_inode()
>   	 */
>   	spin_lock(&inode->i_lock);
> - 	/* Clear I_DIRTY_PAGES if we've written out all dirty pages */
> - 	if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
> - 		inode->i_state &= ~I_DIRTY_PAGES;
> + 
>  -	dirty = inode->i_state & I_DIRTY;
>  -	inode->i_state &= ~I_DIRTY;
>  +	dirty = inode->i_state & I_DIRTY_INODE;
>  +	inode->i_state &= ~I_DIRTY_INODE;
> + 
> + 	/*
> + 	 * Paired with smp_mb() in __mark_inode_dirty().  This allows
> + 	 * __mark_inode_dirty() to test i_state without grabbing i_lock -
> + 	 * either they see the I_DIRTY bits cleared or we see the dirtied
> + 	 * inode.
> + 	 *
> + 	 * I_DIRTY_PAGES is always cleared together above even if @mapping
> + 	 * still has dirty pages.  The flag is reinstated after smp_mb() if
> + 	 * necessary.  This guarantees that either __mark_inode_dirty()
> + 	 * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY.
> + 	 */
> + 	smp_mb();
> + 
> + 	if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
> + 		inode->i_state |= I_DIRTY_PAGES;
> + 
>   	spin_unlock(&inode->i_lock);
> + 
>   	/* Don't write the inode if only I_DIRTY_PAGES was set */
>  -	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
>  +	if (dirty) {
>   		int err = write_inode(inode, wbc);
>   		if (ret == 0)
>   			ret = err;


I think there's a problem in your fix, Stephen.

I'm getting hangs at boot (strangely -- in QEMU -- only when booting
via grub, not when using -kernel) and during shutdown.  Jeremiah seems
to have the same problem and his bisection led to the merge commit:
https://lkml.org/lkml/2014/11/29/17

The following solves both issues for me.  I think it makes sense given
the #defines from ef7fdf5e8c87, since Tejun intended to clear
I_DIRTY_PAGES.


diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index b70e45f45afa..6b2510d97a0a 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -484,7 +484,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
 	spin_lock(&inode->i_lock);
 
 	dirty = inode->i_state & I_DIRTY_INODE;
-	inode->i_state &= ~I_DIRTY_INODE;
+	inode->i_state &= ~I_DIRTY;
 
 	/*
 	 * Paired with smp_mb() in __mark_inode_dirty().  This allows


-- 
Thanks,
Sabrina

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2014-11-29 10:08 ` Sabrina Dubroca
@ 2014-11-29 17:38   ` Theodore Ts'o
  2014-11-29 22:08   ` Jeremiah Mahler
  1 sibling, 0 replies; 15+ messages in thread
From: Theodore Ts'o @ 2014-11-29 17:38 UTC (permalink / raw)
  To: Sabrina Dubroca
  Cc: Stephen Rothwell, Jens Axboe, linux-next, linux-kernel,
	Tejun Heo, Jeremiah Mahler

Note the relevant changes from the ext4 tree were dropped from the
dev branch, so this shouldn't be an issue moving forward.

    	       	    	      	    	  - Ted

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2014-11-29 10:08 ` Sabrina Dubroca
  2014-11-29 17:38   ` Theodore Ts'o
@ 2014-11-29 22:08   ` Jeremiah Mahler
  1 sibling, 0 replies; 15+ messages in thread
From: Jeremiah Mahler @ 2014-11-29 22:08 UTC (permalink / raw)
  To: Sabrina Dubroca
  Cc: Stephen Rothwell, Jens Axboe, Theodore Ts'o, linux-next,
	linux-kernel, Tejun Heo

Hi,

On Sat, Nov 29, 2014 at 11:08:33AM +0100, Sabrina Dubroca wrote:
> Hello,
> 
> [adding Jeremiah Mahler to CC]
> 
> 2014-11-27, 14:53:47 +1100, Stephen Rothwell wrote:
> > Hi Jens,
> > 
> > Today's linux-next merge of the block tree got a conflict in
> > fs/fs-writeback.c between commit ef7fdf5e8c87 ("vfs: add support for a
> > lazytime mount option") from the ext4 tree and commit 9c6ac78eb352
> > ("writeback: fix a subtle race condition in I_DIRTY clearing") from the
> > block tree.
> > 
> > I fixed it up (I took a guess, plese check - see below) and can carry
> > the fix as necessary (no action is required).
> > 
> > -- 
> > Cheers,
> > Stephen Rothwell                    sfr@canb.auug.org.au
> > 
> > diff --cc fs/fs-writeback.c
> > index 3d87174408ae,2d609a5fbfea..000000000000
> > --- a/fs/fs-writeback.c
> > +++ b/fs/fs-writeback.c
> > @@@ -482,14 -479,30 +482,30 @@@ __writeback_single_inode(struct inode *
> >   	 * write_inode()
> >   	 */
> >   	spin_lock(&inode->i_lock);
> > - 	/* Clear I_DIRTY_PAGES if we've written out all dirty pages */
> > - 	if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
> > - 		inode->i_state &= ~I_DIRTY_PAGES;
> > + 
> >  -	dirty = inode->i_state & I_DIRTY;
> >  -	inode->i_state &= ~I_DIRTY;
> >  +	dirty = inode->i_state & I_DIRTY_INODE;
> >  +	inode->i_state &= ~I_DIRTY_INODE;
> > + 
> > + 	/*
> > + 	 * Paired with smp_mb() in __mark_inode_dirty().  This allows
> > + 	 * __mark_inode_dirty() to test i_state without grabbing i_lock -
> > + 	 * either they see the I_DIRTY bits cleared or we see the dirtied
> > + 	 * inode.
> > + 	 *
> > + 	 * I_DIRTY_PAGES is always cleared together above even if @mapping
> > + 	 * still has dirty pages.  The flag is reinstated after smp_mb() if
> > + 	 * necessary.  This guarantees that either __mark_inode_dirty()
> > + 	 * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY.
> > + 	 */
> > + 	smp_mb();
> > + 
> > + 	if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
> > + 		inode->i_state |= I_DIRTY_PAGES;
> > + 
> >   	spin_unlock(&inode->i_lock);
> > + 
> >   	/* Don't write the inode if only I_DIRTY_PAGES was set */
> >  -	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
> >  +	if (dirty) {
> >   		int err = write_inode(inode, wbc);
> >   		if (ret == 0)
> >   			ret = err;
> 
> 
> I think there's a problem in your fix, Stephen.
> 
> I'm getting hangs at boot (strangely -- in QEMU -- only when booting
> via grub, not when using -kernel) and during shutdown.  Jeremiah seems
> to have the same problem and his bisection led to the merge commit:
> https://lkml.org/lkml/2014/11/29/17
> 
> The following solves both issues for me.  I think it makes sense given
> the #defines from ef7fdf5e8c87, since Tejun intended to clear
> I_DIRTY_PAGES.
> 
> 
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index b70e45f45afa..6b2510d97a0a 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -484,7 +484,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
>  	spin_lock(&inode->i_lock);
>  
>  	dirty = inode->i_state & I_DIRTY_INODE;
> -	inode->i_state &= ~I_DIRTY_INODE;
> +	inode->i_state &= ~I_DIRTY;
>  
>  	/*
>  	 * Paired with smp_mb() in __mark_inode_dirty().  This allows
> 
> 
> -- 
> Thanks,
> Sabrina

That change fixes the problem.

Thanks Sabrina and Stephen!

-- 
- Jeremiah Mahler

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2023-06-26  3:09 Stephen Rothwell
  2023-06-26  8:00 ` Christoph Hellwig
@ 2023-06-27  0:46 ` Stephen Rothwell
  1 sibling, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2023-06-27  0:46 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Jens Axboe, Christoph Hellwig, Jan Kara,
	Linux Kernel Mailing List, Linux Next Mailing List, Zhihao Cheng

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

Hi all,

On Mon, 26 Jun 2023 13:09:51 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the block tree got a conflict in:
> 
>   fs/ext4/super.c
> 
> between commit:
> 
>   ffea255f4052 ("ext4: Fix reusing stale buffer heads from last failed mounting")
> 
> from the ext4 tree and commits:
> 
>   2736e8eeb0cc ("block: use the holder as indication for exclusive opens")
>   a42fb5a75ccc ("ext4: Fix warning in blkdev_put()")
> 
> from the block 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 b3819e70093e,64342adcd679..000000000000
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@@ -1128,13 -1133,7 +1133,13 @@@ static void ext4_blkdev_remove(struct e
>   	struct block_device *bdev;
>   	bdev = sbi->s_journal_bdev;
>   	if (bdev) {
>  +		/*
>  +		 * Invalidate the journal device's buffers.  We don't want them
>  +		 * floating about in memory - the physical journal device may
>  +		 * hotswapped, and it breaks the `ro-after' testing code.
>  +		 */
>  +		invalidate_bdev(bdev);
> - 		ext4_blkdev_put(bdev);
> + 		blkdev_put(bdev, sbi->s_sb);
>   		sbi->s_journal_bdev = NULL;
>   	}
>   }

This is now a conflict between the ext4 tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2023-06-26  3:09 Stephen Rothwell
@ 2023-06-26  8:00 ` Christoph Hellwig
  2023-06-27  0:46 ` Stephen Rothwell
  1 sibling, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2023-06-26  8:00 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, Theodore Ts'o, Christoph Hellwig, Jan Kara,
	Linux Kernel Mailing List, Linux Next Mailing List, Zhihao Cheng

Thanks Stephen,

the merge looks good to me.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2023-06-26  3:09 Stephen Rothwell
  2023-06-26  8:00 ` Christoph Hellwig
  2023-06-27  0:46 ` Stephen Rothwell
  0 siblings, 2 replies; 15+ messages in thread
From: Stephen Rothwell @ 2023-06-26  3:09 UTC (permalink / raw)
  To: Jens Axboe, Theodore Ts'o
  Cc: Christoph Hellwig, Jan Kara, Linux Kernel Mailing List,
	Linux Next Mailing List, Zhihao Cheng

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

Hi all,

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

  fs/ext4/super.c

between commit:

  ffea255f4052 ("ext4: Fix reusing stale buffer heads from last failed mounting")

from the ext4 tree and commits:

  2736e8eeb0cc ("block: use the holder as indication for exclusive opens")
  a42fb5a75ccc ("ext4: Fix warning in blkdev_put()")

from the block 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 b3819e70093e,64342adcd679..000000000000
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@@ -1128,13 -1133,7 +1133,13 @@@ static void ext4_blkdev_remove(struct e
  	struct block_device *bdev;
  	bdev = sbi->s_journal_bdev;
  	if (bdev) {
 +		/*
 +		 * Invalidate the journal device's buffers.  We don't want them
 +		 * floating about in memory - the physical journal device may
 +		 * hotswapped, and it breaks the `ro-after' testing code.
 +		 */
 +		invalidate_bdev(bdev);
- 		ext4_blkdev_put(bdev);
+ 		blkdev_put(bdev, sbi->s_sb);
  		sbi->s_journal_bdev = NULL;
  	}
  }

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2023-06-13  2:54 Stephen Rothwell
@ 2023-06-13  5:00 ` Christoph Hellwig
  0 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2023-06-13  5:00 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, Theodore Ts'o, Christoph Hellwig,
	Linux Kernel Mailing List, Linux Next Mailing List, Zhihao Cheng

Hi Stephen,

the merge looks good to me, thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2023-06-13  2:54 Stephen Rothwell
  2023-06-13  5:00 ` Christoph Hellwig
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Rothwell @ 2023-06-13  2:54 UTC (permalink / raw)
  To: Jens Axboe, Theodore Ts'o
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Zhihao Cheng

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

Hi all,

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

  fs/ext4/super.c

between commit:

  63bc068f0d1a ("ext4: Fix reusing stale buffer heads from last failed mounting")

from the ext4 tree and commit:

  2736e8eeb0cc ("block: use the holder as indication for exclusive opens")

from the block 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 b3819e70093e,94a7b56ed876..000000000000
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@@ -1128,13 -1133,7 +1133,13 @@@ static void ext4_blkdev_remove(struct e
  	struct block_device *bdev;
  	bdev = sbi->s_journal_bdev;
  	if (bdev) {
 +		/*
 +		 * Invalidate the journal device's buffers.  We don't want them
 +		 * floating about in memory - the physical journal device may
 +		 * hotswapped, and it breaks the `ro-after' testing code.
 +		 */
 +		invalidate_bdev(bdev);
- 		ext4_blkdev_put(bdev);
+ 		blkdev_put(bdev, sbi->s_es);
  		sbi->s_journal_bdev = NULL;
  	}
  }

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2016-07-15  4:33 Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2016-07-15  4:33 UTC (permalink / raw)
  To: Jens Axboe, Theodore Ts'o
  Cc: linux-next, linux-kernel, Jaegeuk Kim, Mike Christie

Hi all,

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

  fs/ext4/crypto.c

between commit:

  a7550b30ab70 ("ext4 crypto: migrate into vfs's crypto engine")

from the ext4 tree and commits:

  4e49ea4a3d27 ("block/fs/drivers: remove rw argument from submit_bio")
  60a40096a3b2 ("ext4: use bio op helprs in ext4 crypto code")

from the block tree.

I fixed it up (the ext4 tree removed the file, so I did that) 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2014-11-26  2:41 Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2014-11-26  2:41 UTC (permalink / raw)
  To: Jens Axboe, Theodore Ts'o
  Cc: linux-next, linux-kernel, Tejun Heo, Jan Kara

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

Hi Jens,

Today's linux-next merge of the block tree got a conflict in
fs/fs-writeback.c between commit 74ba19abbeae ("vfs: add support for a
lazytime mount option") from the ext4 tree and commit 9c6ac78eb352
("writeback: fix a subtle race condition in I_DIRTY clearing") from the
block tree.

I fixed it up (maybe, please check - see below) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/fs-writeback.c
index cab2d6d74828,2d609a5fbfea..000000000000
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@@ -480,12 -479,28 +480,28 @@@ __writeback_single_inode(struct inode *
  	 * write_inode()
  	 */
  	spin_lock(&inode->i_lock);
- 	/* Clear I_DIRTY_PAGES if we've written out all dirty pages */
- 	if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
- 		inode->i_state &= ~I_DIRTY_PAGES;
+ 
  	dirty = inode->i_state & I_DIRTY;
- 	inode->i_state &= ~(I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_TIME);
 -	inode->i_state &= ~I_DIRTY;
++	inode->i_state &= ~(I_DIRTY | I_DIRTY_TIME);
+ 
+ 	/*
+ 	 * Paired with smp_mb() in __mark_inode_dirty().  This allows
+ 	 * __mark_inode_dirty() to test i_state without grabbing i_lock -
+ 	 * either they see the I_DIRTY bits cleared or we see the dirtied
+ 	 * inode.
+ 	 *
+ 	 * I_DIRTY_PAGES is always cleared together above even if @mapping
+ 	 * still has dirty pages.  The flag is reinstated after smp_mb() if
+ 	 * necessary.  This guarantees that either __mark_inode_dirty()
+ 	 * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY.
+ 	 */
+ 	smp_mb();
+ 
+ 	if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
+ 		inode->i_state |= I_DIRTY_PAGES;
+ 
  	spin_unlock(&inode->i_lock);
+ 
  	/* Don't write the inode if only I_DIRTY_PAGES was set */
  	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
  		int err = write_inode(inode, wbc);

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: manual merge of the block tree with the ext4 tree
  2010-09-21  4:04 Stephen Rothwell
@ 2010-10-23  2:47 ` Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2010-10-23  2:47 UTC (permalink / raw)
  To: Theodore Tso
  Cc: linux-next, linux-kernel, Christoph Hellwig, Lukas Czerner,
	Jens Axboe, Linus

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

Hi Ted,

On Tue, 21 Sep 2010 14:04:10 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the block tree got a conflict in
> fs/ext4/mballoc.c between commit 9c543072a9dd7cf60cbf472914a6480ffda50b27
> ("ext4: Check for negative error code from sb_issue_discard") from the
> ext4 tree and commit 2cf6d26a354ab6362e301b5a323832b02867df47 ("block:
> pass gfp_mask and flags to sb_issue_discard") from the block tree.
> 
> Just context changes.  I fixed it up (see below) and can carry the fix as
> necessary.
> 
> diff --cc fs/ext4/mballoc.c
> index e4f4dae,19aa0d4..0000000
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@@ -2612,8 -2566,8 +2612,8 @@@ static inline void ext4_issue_discard(s
>   	discard_block = block + ext4_group_first_block_no(sb, block_group);
>   	trace_ext4_discard_blocks(sb,
>   			(unsigned long long) discard_block, count);
> - 	ret = sb_issue_discard(sb, discard_block, count);
> + 	ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
>  -	if (ret == EOPNOTSUPP) {
>  +	if (ret == -EOPNOTSUPP) {
>   		ext4_warning(sb, "discard not supported, disabling");
>   		clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);
>   	}

This merge fix will now be necessary when merging with Linus' current tree.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2010-09-21  4:04 Stephen Rothwell
  2010-10-23  2:47 ` Stephen Rothwell
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Rothwell @ 2010-09-21  4:04 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-next, linux-kernel, Christoph Hellwig, Lukas Czerner, Theodore Tso

Hi Jens,

Today's linux-next merge of the block tree got a conflict in
fs/ext4/mballoc.c between commit 9c543072a9dd7cf60cbf472914a6480ffda50b27
("ext4: Check for negative error code from sb_issue_discard") from the
ext4 tree and commit 2cf6d26a354ab6362e301b5a323832b02867df47 ("block:
pass gfp_mask and flags to sb_issue_discard") from the block tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/ext4/mballoc.c
index e4f4dae,19aa0d4..0000000
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@@ -2612,8 -2566,8 +2612,8 @@@ static inline void ext4_issue_discard(s
  	discard_block = block + ext4_group_first_block_no(sb, block_group);
  	trace_ext4_discard_blocks(sb,
  			(unsigned long long) discard_block, count);
- 	ret = sb_issue_discard(sb, discard_block, count);
+ 	ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
 -	if (ret == EOPNOTSUPP) {
 +	if (ret == -EOPNOTSUPP) {
  		ext4_warning(sb, "discard not supported, disabling");
  		clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);
  	}

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: manual merge of the block tree with the ext4 tree
@ 2010-04-29  3:51 Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2010-04-29  3:51 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-next, linux-kernel, Dmitry Monakhov, Theodore Tso

Hi Jens,

Today's linux-next merge of the block tree got a conflict in
fs/ext4/fsync.c between commit a68513a1c88248ee9167a25e32ee8164c3dde02b
("ext4: check missed return value in ext4_sync_file()") from the ext4
tree and commit fbd9b09a177a481eda256447c881f014f29034fe ("blkdev:
generalize flags for blkdev_issue_fn functions") from the block tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/ext4/fsync.c
index 42bd94a,ef3d980e6..0000000
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@@ -100,9 -100,11 +100,11 @@@ int ext4_sync_file(struct file *file, s
  		if (ext4_should_writeback_data(inode) &&
  		    (journal->j_fs_dev != journal->j_dev) &&
  		    (journal->j_flags & JBD2_BARRIER))
- 			blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
+ 			blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL,
+ 					NULL, BLKDEV_IFL_WAIT);
 -		jbd2_log_wait_commit(journal, commit_tid);
 +		ret = jbd2_log_wait_commit(journal, commit_tid);
  	} else if (journal->j_flags & JBD2_BARRIER)
- 		blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
+ 		blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL,
+ 			BLKDEV_IFL_WAIT);
  	return ret;
  }

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-27  0:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27  3:53 linux-next: manual merge of the block tree with the ext4 tree Stephen Rothwell
2014-11-27  7:38 ` Christoph Hellwig
2014-11-29 10:08 ` Sabrina Dubroca
2014-11-29 17:38   ` Theodore Ts'o
2014-11-29 22:08   ` Jeremiah Mahler
  -- strict thread matches above, loose matches on Subject: below --
2023-06-26  3:09 Stephen Rothwell
2023-06-26  8:00 ` Christoph Hellwig
2023-06-27  0:46 ` Stephen Rothwell
2023-06-13  2:54 Stephen Rothwell
2023-06-13  5:00 ` Christoph Hellwig
2016-07-15  4:33 Stephen Rothwell
2014-11-26  2:41 Stephen Rothwell
2010-09-21  4:04 Stephen Rothwell
2010-10-23  2:47 ` Stephen Rothwell
2010-04-29  3:51 Stephen Rothwell

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).