linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the akpm-current tree with the ext4 tree
@ 2013-08-19  7:06 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2013-08-19  7:06 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-next, linux-kernel, Kirill A. Shutemov, Jan Kara,
	Theodore Ts'o

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

Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in
fs/ext4/inode.c between commit 4958dee0e70f ("ext4: simplify truncation
code in ext4_setattr()") from the ext4 tree and commit fb6854ec9753
("truncate: drop 'oldsize' truncate_pagecache() parameter") from the
akpm-current tree.

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

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

diff --cc fs/ext4/inode.c
index fc4051e,9257d79..0000000
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@@ -4598,9 -4523,7 +4598,8 @@@ int ext4_setattr(struct dentry *dentry
  		ext4_journal_stop(handle);
  	}
  
 -	if (attr->ia_valid & ATTR_SIZE) {
 +	if (attr->ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
 +		handle_t *handle;
- 		loff_t oldsize = inode->i_size;
  
  		if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
  			struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
@@@ -4608,69 -4531,71 +4607,69 @@@
  			if (attr->ia_size > sbi->s_bitmap_maxbytes)
  				return -EFBIG;
  		}
 -	}
 -
 -	if (S_ISREG(inode->i_mode) &&
 -	    attr->ia_valid & ATTR_SIZE &&
 -	    (attr->ia_size < inode->i_size)) {
 -		handle_t *handle;
 -
 -		handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
 -		if (IS_ERR(handle)) {
 -			error = PTR_ERR(handle);
 -			goto err_out;
 -		}
 -		if (ext4_handle_valid(handle)) {
 -			error = ext4_orphan_add(handle, inode);
 -			orphan = 1;
 -		}
 -		EXT4_I(inode)->i_disksize = attr->ia_size;
 -		rc = ext4_mark_inode_dirty(handle, inode);
 -		if (!error)
 -			error = rc;
 -		ext4_journal_stop(handle);
 -
 -		if (ext4_should_order_data(inode)) {
 -			error = ext4_begin_ordered_truncate(inode,
 +		if (S_ISREG(inode->i_mode) &&
 +		    (attr->ia_size < inode->i_size)) {
 +			if (ext4_should_order_data(inode)) {
 +				error = ext4_begin_ordered_truncate(inode,
  							    attr->ia_size);
 -			if (error) {
 -				/* Do as much error cleanup as possible */
 -				handle = ext4_journal_start(inode,
 -							    EXT4_HT_INODE, 3);
 -				if (IS_ERR(handle)) {
 -					ext4_orphan_del(NULL, inode);
 +				if (error)
  					goto err_out;
 -				}
 -				ext4_orphan_del(handle, inode);
 -				orphan = 0;
 -				ext4_journal_stop(handle);
 +			}
 +			handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
 +			if (IS_ERR(handle)) {
 +				error = PTR_ERR(handle);
  				goto err_out;
  			}
 -		}
 -	}
 -
 -	if (attr->ia_valid & ATTR_SIZE) {
 -		if (attr->ia_size != inode->i_size) {
 -			i_size_write(inode, attr->ia_size);
 -			/*
 -			 * Blocks are going to be removed from the inode. Wait
 -			 * for dio in flight.  Temporarily disable
 -			 * dioread_nolock to prevent livelock.
 -			 */
 -			if (orphan) {
 -				if (!ext4_should_journal_data(inode)) {
 -					ext4_inode_block_unlocked_dio(inode);
 -					inode_dio_wait(inode);
 -					ext4_inode_resume_unlocked_dio(inode);
 -				} else
 -					ext4_wait_for_tail_page_commit(inode);
 +			if (ext4_handle_valid(handle)) {
 +				error = ext4_orphan_add(handle, inode);
 +				orphan = 1;
  			}
 +			down_write(&EXT4_I(inode)->i_data_sem);
 +			EXT4_I(inode)->i_disksize = attr->ia_size;
 +			rc = ext4_mark_inode_dirty(handle, inode);
 +			if (!error)
 +				error = rc;
  			/*
 -			 * Truncate pagecache after we've waited for commit
 -			 * in data=journal mode to make pages freeable.
 +			 * We have to update i_size under i_data_sem together
 +			 * with i_disksize to avoid races with writeback code
 +			 * running ext4_wb_update_i_disksize().
  			 */
 -			truncate_pagecache(inode, inode->i_size);
 +			if (!error)
 +				i_size_write(inode, attr->ia_size);
 +			up_write(&EXT4_I(inode)->i_data_sem);
 +			ext4_journal_stop(handle);
 +			if (error) {
 +				ext4_orphan_del(NULL, inode);
 +				goto err_out;
 +			}
 +		} else
 +			i_size_write(inode, attr->ia_size);
 +
 +		/*
 +		 * Blocks are going to be removed from the inode. Wait
 +		 * for dio in flight.  Temporarily disable
 +		 * dioread_nolock to prevent livelock.
 +		 */
 +		if (orphan) {
 +			if (!ext4_should_journal_data(inode)) {
 +				ext4_inode_block_unlocked_dio(inode);
 +				inode_dio_wait(inode);
 +				ext4_inode_resume_unlocked_dio(inode);
 +			} else
 +				ext4_wait_for_tail_page_commit(inode);
  		}
 -		ext4_truncate(inode);
 +		/*
 +		 * Truncate pagecache after we've waited for commit
 +		 * in data=journal mode to make pages freeable.
 +		 */
- 		truncate_pagecache(inode, oldsize, inode->i_size);
++		truncate_pagecache(inode, inode->i_size);
  	}
 +	/*
 +	 * We want to call ext4_truncate() even if attr->ia_size ==
 +	 * inode->i_size for cases like truncation of fallocated space
 +	 */
 +	if (attr->ia_valid & ATTR_SIZE)
 +		ext4_truncate(inode);
  
  	if (!rc) {
  		setattr_copy(inode, attr);

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

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

* linux-next: manual merge of the akpm-current tree with the ext4 tree
@ 2017-11-02  7:43 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2017-11-02  7:43 UTC (permalink / raw)
  To: Andrew Morton, Theodore Ts'o
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Mel Gorman,
	Christoph Hellwig, Andreas Gruenbacher

Hi Andrew,

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

  fs/ext4/file.c

between commit:

  545052e9e35a ("ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA")

from the ext4 tree and commit:

  f7d4010a3383 ("mm, pagevec: remove cold parameter for pagevecs")

from the akpm-current tree.

I fixed it up (the former removed the reference to pagevec_init that
was updated in the latter) 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] 4+ messages in thread

* linux-next: manual merge of the akpm-current tree with the ext4 tree
@ 2016-07-01  5:35 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2016-07-01  5:35 UTC (permalink / raw)
  To: Andrew Morton, Theodore Ts'o
  Cc: linux-next, linux-kernel, Jan Kara, Fabian Frederick,
	Christoph Hellwig, Lukas Czerner

Hi Andrew,

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

  fs/ext4/fsync.c

between commit:

  78d962510796 ("ext4: respect the nobarrier mount option in nojournal mode")

from the ext4 tree and commit:

  045d9e206ac0 ("fs/ext4/fsync.c: generic_file_fsync call based on barrier flag")

from the akpm-current tree.

I fixed it up (I used the ext4 tree version) 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] 4+ messages in thread

* linux-next: manual merge of the akpm-current tree with the ext4 tree
@ 2014-05-27  8:09 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2014-05-27  8:09 UTC (permalink / raw)
  To: Andrew Morton, Theodore Ts'o
  Cc: linux-next, linux-kernel, Jan Kara, Matthew Wilcox

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

Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in
fs/ext4/page-io.c between commit a3f79014dc44 ("ext4: fix zeroing of
page during writeback") from the ext4 tree and commit 97527831700a
("fs/buffer.c: remove block_write_full_page_endio()") from the
akpm-current tree.

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

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

diff --cc fs/ext4/page-io.c
index b6a3804a9855,1a64e7a52b84..000000000000
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@@ -422,17 -418,6 +422,17 @@@ int ext4_bio_write_page(struct ext4_io_
  	ClearPageError(page);
  
  	/*
- 	 * Comments copied from block_write_full_page_endio:
++	 * Comments copied from block_write_full_page:
 +	 *
 +	 * The page straddles i_size.  It must be zeroed out on each and every
 +	 * writepage invocation because it may be mmapped.  "A file is mapped
 +	 * in multiples of the page size.  For a file that is not a multiple of
 +	 * the page size, the remaining memory is zeroed when mapped, and
 +	 * writes to that region are not written out to the file."
 +	 */
 +	if (len < PAGE_CACHE_SIZE)
 +		zero_user_segment(page, len, PAGE_CACHE_SIZE);
 +	/*
  	 * In the first loop we prepare and mark buffers to submit. We have to
  	 * mark all buffers in the page before submitting so that
  	 * end_page_writeback() cannot be called from ext4_bio_end_io() when IO

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2017-11-02  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19  7:06 linux-next: manual merge of the akpm-current tree with the ext4 tree Stephen Rothwell
2014-05-27  8:09 Stephen Rothwell
2016-07-01  5:35 Stephen Rothwell
2017-11-02  7:43 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).