Re: linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2019-09-23 Thread David Sterba
On Thu, Sep 19, 2019 at 12:31:06PM +0100, Mark Brown wrote:
> Hi all,
> 
> Today's linux-next merge of the btrfs-kdave tree got conflicts in:
> 
>   fs/btrfs/block-group.c
>   fs/btrfs/ctree.h
>   fs/btrfs/extent-tree.c
>   fs/btrfs/send.c
>   fs/btrfs/space-info.c
>   include/uapi/linux/btrfs_tree.h
> 
> between a number of commits in Linus' tree and a number of commits in
> the btrfs-kdave tree.  I don't feel comfortable that I can resolve these
> safely and the btrfs-kdave tree hasn't changed since August with the
> last non-merge commit in June so I've dropped the tree for today.

Dropping the tree temporarily is ok. I'm going to refresh the source
branch today so it should be in a good shape for next linux-next
snapshot.


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2019-09-19 Thread Mark Brown
Hi all,

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

  fs/btrfs/block-group.c
  fs/btrfs/ctree.h
  fs/btrfs/extent-tree.c
  fs/btrfs/send.c
  fs/btrfs/space-info.c
  include/uapi/linux/btrfs_tree.h

between a number of commits in Linus' tree and a number of commits in
the btrfs-kdave tree.  I don't feel comfortable that I can resolve these
safely and the btrfs-kdave tree hasn't changed since August with the
last non-merge commit in June so I've dropped the tree for today.


signature.asc
Description: PGP signature


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2018-02-06 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/tree-log.c

between commit:

  c7f88c4e78f5 ("btrfs: convert to new i_version API")

from Linus' tree and commit:

  8bd2a9b19fd7 ("btrfs: Remove custom crc32c init code")

from the btrfs-kdave 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/tree-log.c
index afadaadab18e,df8e76d01dbe..
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@@ -20,7 -20,7 +20,8 @@@
  #include 
  #include 
  #include 
 +#include 
+ #include "ctree.h"
  #include "tree-log.h"
  #include "disk-io.h"
  #include "locking.h"


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2018-02-06 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/disk-io.c

between commit:

  540adea3809f ("error-injection: Separate error-injection from kprobe")

from Linus' tree and commit:

  8bd2a9b19fd7 ("btrfs: Remove custom crc32c init code")

from the btrfs-kdave 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 f9cef2f8d1a5,ff64113ec5f0..
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -30,7 -30,7 +30,8 @@@
  #include 
  #include 
  #include 
 +#include 
+ #include 
  #include 
  #include "ctree.h"
  #include "disk-io.h"


Re: linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2017-09-03 Thread Stephen Rothwell
Hi all,

On Fri, 25 Aug 2017 09:58:25 +1000 Stephen Rothwell  
wrote:
>
> Today's linux-next merge of the btrfs-kdave tree got a conflict in:
> 
>   fs/btrfs/inode.c
> 
> between commit:
> 
>   58efbc9f5463 ("Btrfs: fix blk_status_t/errno confusion")
> 
> from Linus' tree and commit:
> 
>   e6961cac730f ("btrfs: Move skip checksum check from btrfs_submit_direct to 
> __btrfs_submit_dio_bio")
> 
> from the btrfs-kdave 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/inode.c
> index 24bcd5cd9cf2,d184a46e46c4..
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@@ -7991,10 -8080,9 +8081,10 @@@ static blk_status_t dio_read_error(stru
>   struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree;
>   struct bio *bio;
>   int isector;
> - int read_mode = 0;
> + unsigned int read_mode = 0;
>   int segs;
>   int ret;
>  +blk_status_t status;
>   
>   BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE);
>   
> @@@ -8021,11 -8109,11 +8111,11 @@@
>   bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
>   
>   btrfs_debug(BTRFS_I(inode)->root->fs_info,
> - "Repair DIO Read Error: submitting new dio read[%#x] to 
> this_mirror=%d, in_validation=%d\n",
> + "repair DIO read error: submitting new dio read[%#x] to 
> this_mirror=%d, in_validation=%d",
>   read_mode, failrec->this_mirror, failrec->in_validation);
>   
>  -ret = submit_dio_repair_bio(inode, bio, failrec->this_mirror);
>  -if (ret) {
>  +status = submit_dio_repair_bio(inode, bio, failrec->this_mirror);
>  +if (status) {
>   free_io_failure(failure_tree, io_tree, failrec);
>   bio_put(bio);
>   }
> @@@ -8426,9 -8513,8 +8516,9 @@@ static inline blk_status_t btrfs_lookup
>   return 0;
>   }
>   
>  -static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode 
> *inode,
>  - u64 file_offset, int async_submit)
>  +static inline blk_status_t
>  +__btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, u64 
> file_offset,
> -int skip_sum, int async_submit)
> ++   int async_submit)
>   {
>   struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
>   struct btrfs_dio_private *dip = bio->bi_private;
> @@@ -8541,9 -8625,9 +8630,9 @@@ static int btrfs_submit_direct_hook(str
>*/
>   atomic_inc(&dip->pending_bios);
>   
> - status = __btrfs_submit_dio_bio(bio, inode, file_offset, 
> skip_sum,
>  -ret = __btrfs_submit_dio_bio(bio, inode, file_offset,
>  - async_submit);
>  -if (ret) {
> ++status = __btrfs_submit_dio_bio(bio, inode, file_offset,
>  +async_submit);
>  +if (status) {
>   bio_put(bio);
>   atomic_dec(&dip->pending_bios);
>   goto out_err;
> @@@ -8561,9 -8645,8 +8650,8 @@@
>   } while (submit_len > 0);
>   
>   submit:
> - status = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum,
> - async_submit);
>  -ret = __btrfs_submit_dio_bio(bio, inode, file_offset, async_submit);
>  -if (!ret)
> ++status = __btrfs_submit_dio_bio(bio, inode, file_offset, async_submit);
>  +if (!status)
>   return 0;
>   
>   bio_put(bio);

Just a reminder that this conflict still exists.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2017-08-24 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/inode.c

between commit:

  58efbc9f5463 ("Btrfs: fix blk_status_t/errno confusion")

from Linus' tree and commit:

  e6961cac730f ("btrfs: Move skip checksum check from btrfs_submit_direct to 
__btrfs_submit_dio_bio")

from the btrfs-kdave 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/inode.c
index 24bcd5cd9cf2,d184a46e46c4..
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7991,10 -8080,9 +8081,10 @@@ static blk_status_t dio_read_error(stru
struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree;
struct bio *bio;
int isector;
-   int read_mode = 0;
+   unsigned int read_mode = 0;
int segs;
int ret;
 +  blk_status_t status;
  
BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE);
  
@@@ -8021,11 -8109,11 +8111,11 @@@
bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
  
btrfs_debug(BTRFS_I(inode)->root->fs_info,
-   "Repair DIO Read Error: submitting new dio read[%#x] to 
this_mirror=%d, in_validation=%d\n",
+   "repair DIO read error: submitting new dio read[%#x] to 
this_mirror=%d, in_validation=%d",
read_mode, failrec->this_mirror, failrec->in_validation);
  
 -  ret = submit_dio_repair_bio(inode, bio, failrec->this_mirror);
 -  if (ret) {
 +  status = submit_dio_repair_bio(inode, bio, failrec->this_mirror);
 +  if (status) {
free_io_failure(failure_tree, io_tree, failrec);
bio_put(bio);
}
@@@ -8426,9 -8513,8 +8516,9 @@@ static inline blk_status_t btrfs_lookup
return 0;
  }
  
 -static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode,
 -   u64 file_offset, int async_submit)
 +static inline blk_status_t
 +__btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, u64 file_offset,
-  int skip_sum, int async_submit)
++ int async_submit)
  {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
struct btrfs_dio_private *dip = bio->bi_private;
@@@ -8541,9 -8625,9 +8630,9 @@@ static int btrfs_submit_direct_hook(str
 */
atomic_inc(&dip->pending_bios);
  
-   status = __btrfs_submit_dio_bio(bio, inode, file_offset, 
skip_sum,
 -  ret = __btrfs_submit_dio_bio(bio, inode, file_offset,
 -   async_submit);
 -  if (ret) {
++  status = __btrfs_submit_dio_bio(bio, inode, file_offset,
 +  async_submit);
 +  if (status) {
bio_put(bio);
atomic_dec(&dip->pending_bios);
goto out_err;
@@@ -8561,9 -8645,8 +8650,8 @@@
} while (submit_len > 0);
  
  submit:
-   status = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum,
-   async_submit);
 -  ret = __btrfs_submit_dio_bio(bio, inode, file_offset, async_submit);
 -  if (!ret)
++  status = __btrfs_submit_dio_bio(bio, inode, file_offset, async_submit);
 +  if (!status)
return 0;
  
bio_put(bio);


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2017-07-23 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/scrub.c

between commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from Linus' tree and commit:

  26397a4ad1d5 ("btrfs: account that we're waiting for IO in 
scrub_submit_raid56_bio_wait")

from the btrfs-kdave 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/scrub.c
index 6f1e4c984b94,7bce7b43c48b..
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@@ -1704,8 -1704,8 +1704,8 @@@ static int scrub_submit_raid56_bio_wait
if (ret)
return ret;
  
-   wait_for_completion(&done.event);
+   wait_for_completion_io(&done.event);
 -  if (done.error)
 +  if (done.status)
return -EIO;
  
return 0;


Re: linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2017-07-21 Thread David Sterba
On Tue, Jul 18, 2017 at 10:18:02AM +1000, Stephen Rothwell wrote:
> Hi David,
> 
> Today's linux-next merge of the btrfs-kdave tree got a conflict in:
> 
>   fs/btrfs/extent_io.c
> 
> between commit:
> 
>   e6959b9350c6 ("btrfs: add support for passing in write hints for buffered 
> writes")
> 
> from Linus' tree and commit:
> 
>   41a3f2a7c062 ("btrfs: merge REQ_OP and REQ_ flags to one parameter in 
> submit_extent_page")
> 
> from the btrfs-kdave 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.
> 
> You should probably consider rebasing your for-next branch onto (at
> least v4.13-rc1) (or merging v4.13-rc1) to save these sort of
> (unnecessary) conflicts being ongoing during development and the next
> merge window.

tl;dr I'm going to rebase for-next to 4.12 again

I've started rebasing on top of rc1 but found that several tests double
the run time. I've observed something similar already during the merge
window when testing master + pull request branch. The submit bio calls
were particularly visible in the stacks so I'm suspecting some block
layer related change or my system is misconfigured.

In order to be able to debug the problems further, I need a branch that
will reproduce the good results. For that reason I'll rebase back my
for-next branche to the 4.12-rc7. The following merge conflict will
reappear.

> diff --cc fs/btrfs/extent_io.c
> index 0aff9b278c19,ead9e731e01b..
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@@ -2803,8 -2801,7 +2805,8 @@@ static int submit_extent_page(unsigned 
>   bio_add_page(bio, page, page_size, offset);
>   bio->bi_end_io = end_io_func;
>   bio->bi_private = tree;
>  +bio->bi_write_hint = page->mapping->host->i_write_hint;
> - bio_set_op_attrs(bio, op, op_flags);
> + bio->bi_opf = opf;
>   if (wbc) {
>   wbc_init_bio(wbc, bio);
>   wbc_account_io(wbc, page, page_size);


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2017-07-17 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/extent_io.c

between commit:

  e6959b9350c6 ("btrfs: add support for passing in write hints for buffered 
writes")

from Linus' tree and commit:

  41a3f2a7c062 ("btrfs: merge REQ_OP and REQ_ flags to one parameter in 
submit_extent_page")

from the btrfs-kdave 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.

You should probably consider rebasing your for-next branch onto (at
least v4.13-rc1) (or merging v4.13-rc1) to save these sort of
(unnecessary) conflicts being ongoing during development and the next
merge window.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index 0aff9b278c19,ead9e731e01b..
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -2803,8 -2801,7 +2805,8 @@@ static int submit_extent_page(unsigned 
bio_add_page(bio, page, page_size, offset);
bio->bi_end_io = end_io_func;
bio->bi_private = tree;
 +  bio->bi_write_hint = page->mapping->host->i_write_hint;
-   bio_set_op_attrs(bio, op, op_flags);
+   bio->bi_opf = opf;
if (wbc) {
wbc_init_bio(wbc, bio);
wbc_account_io(wbc, page, page_size);


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-12-14 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/inode.c

between commit:

  70fd76140a6c ("block,fs: use REQ_* flags directly")

from Linus' tree and commit:

  da17066c4047 ("btrfs: pull node/sector/stripe sizes out of root and into 
fs_info")

from the btrfs-kdave 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/inode.c
index a4c879671b9d,b2a577cf001f..
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7935,8 -7941,10 +7941,8 @@@ static int dio_read_error(struct inode 
  
if ((failed_bio->bi_vcnt > 1)
|| (failed_bio->bi_io_vec->bv_len
-   > BTRFS_I(inode)->root->sectorsize))
+   > btrfs_inode_sectorsize(inode)))
 -  read_mode = READ_SYNC | REQ_FAILFAST_DEV;
 -  else
 -  read_mode = READ_SYNC;
 +  read_mode |= REQ_FAILFAST_DEV;
  
isector = start - btrfs_io_bio(failed_bio)->logical;
isector >>= inode->i_sb->s_blocksize_bits;


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-09-04 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/send.c

between commit:

  3dc09ec895f0 ("Btrfs: kill invalid ASSERT() in process_all_refs()")

from Linus' tree and commit:

  8e991cbbea49 ("Btrfs: handle pending renames with recycled inodes properly")

from the btrfs-kdave tree.

I fixed it up (I just used the latter 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


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-04-04 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/volumes.c

between commit:

  09cbfeaf1a5a ("mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} 
macros")

from Linus' tree and commit:

  b54a17371a08 ("btrfs: create a helper function to read the disk super")

from the btrfs-kdave 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/volumes.c
index bd0f45fb38c4,09ca95083674..
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@@ -988,6 -1004,56 +1004,56 @@@ int btrfs_open_devices(struct btrfs_fs_
return ret;
  }
  
+ void btrfs_release_disk_super(struct page *page)
+ {
+   kunmap(page);
 -  page_cache_release(page);
++  put_page(page);
+ }
+ 
+ int btrfs_read_disk_super(struct block_device *bdev, u64 bytenr,
+   struct page **page, struct btrfs_super_block **disk_super)
+ {
+   void *p;
+   pgoff_t index;
+ 
+   /* make sure our super fits in the device */
 -  if (bytenr + PAGE_CACHE_SIZE >= i_size_read(bdev->bd_inode))
++  if (bytenr + PAGE_SIZE >= i_size_read(bdev->bd_inode))
+   return 1;
+ 
+   /* make sure our super fits in the page */
 -  if (sizeof(**disk_super) > PAGE_CACHE_SIZE)
++  if (sizeof(**disk_super) > PAGE_SIZE)
+   return 1;
+ 
+   /* make sure our super doesn't straddle pages on disk */
 -  index = bytenr >> PAGE_CACHE_SHIFT;
 -  if ((bytenr + sizeof(**disk_super) - 1) >> PAGE_CACHE_SHIFT != index)
++  index = bytenr >> PAGE_SHIFT;
++  if ((bytenr + sizeof(**disk_super) - 1) >> PAGE_SHIFT != index)
+   return 1;
+ 
+   /* pull in the page with our super */
+   *page = read_cache_page_gfp(bdev->bd_inode->i_mapping,
+  index, GFP_KERNEL);
+ 
+   if (IS_ERR_OR_NULL(*page))
+   return 1;
+ 
+   p = kmap(*page);
+ 
+   /* align our pointer to the offset of the super block */
 -  *disk_super = p + (bytenr & ~PAGE_CACHE_MASK);
++  *disk_super = p + (bytenr & ~PAGE_MASK);
+ 
+   if (btrfs_super_bytenr(*disk_super) != bytenr ||
+   btrfs_super_magic(*disk_super) != BTRFS_MAGIC) {
+   btrfs_release_disk_super(*page);
+   return 1;
+   }
+ 
+   if ((*disk_super)->label[0] &&
+   (*disk_super)->label[BTRFS_LABEL_SIZE - 1])
+   (*disk_super)->label[BTRFS_LABEL_SIZE - 1] = '\0';
+ 
+   return 0;
+ }
+ 
  /*
   * Look for a btrfs signature on a device. This may be called out of the 
mount path
   * and we are not allowed to call set_blocksize during the scan. The 
superblock


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-04-04 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/file.c

between commit:

  09cbfeaf1a5a ("mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} 
macros")

from Linus' tree and commit:

  201c5fdc44d7 ("Btrfs: don't do nocow check unless we have to")

from the btrfs-kdave 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/file.c
index cf31a60c6284,1bc8d464d415..
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@@ -1534,30 -1534,30 +1534,30 @@@ static noinline ssize_t __btrfs_buffere
reserve_bytes = round_up(write_bytes + sector_offset,
root->sectorsize);
  
-   if ((BTRFS_I(inode)->flags & (BTRFS_INODE_NODATACOW |
- BTRFS_INODE_PREALLOC)) &&
-   check_can_nocow(inode, pos, &write_bytes) > 0) {
-   /*
-* For nodata cow case, no need to reserve
-* data space.
-*/
-   only_release_metadata = true;
-   /*
-* our prealloc extent may be smaller than
-* write_bytes, so scale down.
-*/
-   num_pages = DIV_ROUND_UP(write_bytes + offset,
-PAGE_SIZE);
-   reserve_bytes = round_up(write_bytes + sector_offset,
-   root->sectorsize);
-   goto reserve_metadata;
-   }
- 
ret = btrfs_check_data_free_space(inode, pos, write_bytes);
-   if (ret < 0)
-   break;
+   if (ret < 0) {
+   if ((BTRFS_I(inode)->flags & (BTRFS_INODE_NODATACOW |
+ BTRFS_INODE_PREALLOC)) &&
+   check_can_nocow(inode, pos, &write_bytes) > 0) {
+   /*
+* For nodata cow case, no need to reserve
+* data space.
+*/
+   only_release_metadata = true;
+   /*
+* our prealloc extent may be smaller than
+* write_bytes, so scale down.
+*/
+   num_pages = DIV_ROUND_UP(write_bytes + offset,
 -   PAGE_CACHE_SIZE);
++   PAGE_SIZE);
+   reserve_bytes = round_up(write_bytes +
+sector_offset,
+root->sectorsize);
+   } else {
+   break;
+   }
+   }
  
- reserve_metadata:
ret = btrfs_delalloc_reserve_metadata(inode, reserve_bytes);
if (ret) {
if (!only_release_metadata)


linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-04-04 Thread Stephen Rothwell
Hi David,

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

  fs/btrfs/extent_io.c

between commit:

  09cbfeaf1a5a ("mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} 
macros")

from Linus' tree and commit:

  a7424783a24d ("Btrfs: make mapping->writeback_index point to the last written 
page")

from the btrfs-kdave 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/extent_io.c
index d247fc0eea19,46a5c12906ae..
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -3946,8 -3945,10 +3943,10 @@@ static int extent_write_cache_pages(str
index = mapping->writeback_index; /* Start from prev offset */
end = -1;
} else {
 -  index = wbc->range_start >> PAGE_CACHE_SHIFT;
 -  end = wbc->range_end >> PAGE_CACHE_SHIFT;
 +  index = wbc->range_start >> PAGE_SHIFT;
 +  end = wbc->range_end >> PAGE_SHIFT;
+   if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
+   range_whole = 1;
scanned = 1;
}
if (wbc->sync_mode == WB_SYNC_ALL)


Re: linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-02-01 Thread Chandan Rajendra
On Tuesday 02 Feb 2016 10:22:16 Stephen Rothwell wrote:
> 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).

The fixes look good to me. Thanks for doing this.

-- 
chandan



linux-next: manual merge of the btrfs-kdave tree with Linus' tree

2016-02-01 Thread Stephen Rothwell
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..
--- 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;
}
}