linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: David Sterba <dsterba@suse.cz>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chandan Rajendra <chandan@linux.vnet.ibm.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: linux-next: manual merge of the btrfs-kdave tree with Linus' tree
Date: Tue, 2 Feb 2016 10:22:16 +1100	[thread overview]
Message-ID: <20160202102216.60d1d550@canb.auug.org.au> (raw)

Hi David,

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

  fs/btrfs/file.c

between commit:

  5955102c9984 ("wrappers for ->i_mutex access")

from Linus' tree and commit:

  9703fefe0b13 ("Btrfs: fallocate: Work with sectorsized blocks")

from the btrfs-kdave tree.

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

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/file.c
index 098bb8f690c9,953f0ad17802..000000000000
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@@ -1761,11 -1778,13 +1778,13 @@@ static ssize_t btrfs_file_write_iter(st
  	ssize_t err;
  	loff_t pos;
  	size_t count;
+ 	loff_t oldsize;
+ 	int clean_page = 0;
  
 -	mutex_lock(&inode->i_mutex);
 +	inode_lock(inode);
  	err = generic_write_checks(iocb, from);
  	if (err <= 0) {
 -		mutex_unlock(&inode->i_mutex);
 +		inode_unlock(inode);
  		return err;
  	}
  
@@@ -1799,14 -1818,17 +1818,17 @@@
  	pos = iocb->ki_pos;
  	count = iov_iter_count(from);
  	start_pos = round_down(pos, root->sectorsize);
- 	if (start_pos > i_size_read(inode)) {
+ 	oldsize = i_size_read(inode);
+ 	if (start_pos > oldsize) {
  		/* Expand hole size to cover write data, preventing empty gap */
  		end_pos = round_up(pos + count, root->sectorsize);
- 		err = btrfs_cont_expand(inode, i_size_read(inode), end_pos);
+ 		err = btrfs_cont_expand(inode, oldsize, end_pos);
  		if (err) {
 -			mutex_unlock(&inode->i_mutex);
 +			inode_unlock(inode);
  			goto out;
  		}
+ 		if (start_pos > round_up(oldsize, root->sectorsize))
+ 			clean_page = 1;
  	}
  
  	if (sync)
@@@ -1818,9 -1840,12 +1840,12 @@@
  		num_written = __btrfs_buffered_write(file, from, pos);
  		if (num_written > 0)
  			iocb->ki_pos = pos + num_written;
+ 		if (clean_page)
+ 			pagecache_isize_extended(inode, oldsize,
+ 						i_size_read(inode));
  	}
  
 -	mutex_unlock(&inode->i_mutex);
 +	inode_unlock(inode);
  
  	/*
  	 * We also have to set last_sub_trans to the current log transid,
@@@ -2303,8 -2328,8 +2328,8 @@@ static int btrfs_punch_hole(struct inod
  	if (ret)
  		return ret;
  
 -	mutex_lock(&inode->i_mutex);
 +	inode_lock(inode);
- 	ino_size = round_up(inode->i_size, PAGE_CACHE_SIZE);
+ 	ino_size = round_up(inode->i_size, root->sectorsize);
  	ret = find_first_non_hole(inode, &offset, &len);
  	if (ret < 0)
  		goto out_only_mutex;
@@@ -2338,12 -2362,12 +2362,12 @@@
  		goto out_only_mutex;
  	}
  
- 	/* zero back part of the first page */
+ 	/* zero back part of the first block */
  	if (offset < ino_size) {
- 		truncated_page = true;
- 		ret = btrfs_truncate_page(inode, offset, 0, 0);
+ 		truncated_block = true;
+ 		ret = btrfs_truncate_block(inode, offset, 0, 0);
  		if (ret) {
 -			mutex_unlock(&inode->i_mutex);
 +			inode_unlock(inode);
  			return ret;
  		}
  	}

             reply	other threads:[~2016-02-01 23:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 23:22 Stephen Rothwell [this message]
2016-02-02  5:16 ` linux-next: manual merge of the btrfs-kdave tree with Linus' tree Chandan Rajendra
2016-04-05  0:32 Stephen Rothwell
2016-04-05  0:32 Stephen Rothwell
2016-04-05  0:32 Stephen Rothwell
2016-09-05  1:47 Stephen Rothwell
2016-12-14 23:25 Stephen Rothwell
2017-07-18  0:18 Stephen Rothwell
2017-07-21 13:49 ` David Sterba
2017-07-24  0:54 Stephen Rothwell
2017-08-24 23:58 Stephen Rothwell
2017-09-04  6:02 ` Stephen Rothwell
2018-02-06 23:45 Stephen Rothwell
2018-02-06 23:49 Stephen Rothwell
2019-09-19 11:31 Mark Brown
2019-09-23 11:59 ` David Sterba

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=20160202102216.60d1d550@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=chandan@linux.vnet.ibm.com \
    --cc=dsterba@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).