Re: [PATCH] Btrfs: search parity device wisely

2017-08-03 Thread kbuild test robot
Hi Liu,

[auto build test ERROR on v4.13-rc3]
[also build test ERROR on next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Liu-Bo/Btrfs-search-parity-device-wisely/20170803-193103
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   fs/btrfs/raid56.c: In function 'raid56_parity_alloc_scrub_rbio':
>> fs/btrfs/raid56.c:2232:15: error: 'struct btrfs_raid_bio' has no member 
>> named 'data_stripes'
 for (i = rbio->data_stripes; i < rbio->real_stripes; i++) {
  ^

vim +2232 fs/btrfs/raid56.c

  2201  
  2202  /*
  2203   * The following code is used to scrub/replace the parity stripe
  2204   *
  2205   * Caller must have already increased bio_counter for getting @bbio.
  2206   *
  2207   * Note: We need make sure all the pages that add into the scrub/replace
  2208   * raid bio are correct and not be changed during the scrub/replace. 
That
  2209   * is those pages just hold metadata or file data with checksum.
  2210   */
  2211  
  2212  struct btrfs_raid_bio *
  2213  raid56_parity_alloc_scrub_rbio(struct btrfs_fs_info *fs_info, struct 
bio *bio,
  2214 struct btrfs_bio *bbio, u64 stripe_len,
  2215 struct btrfs_device *scrub_dev,
  2216 unsigned long *dbitmap, int 
stripe_nsectors)
  2217  {
  2218  struct btrfs_raid_bio *rbio;
  2219  int i;
  2220  
  2221  rbio = alloc_rbio(fs_info, bbio, stripe_len);
    if (IS_ERR(rbio))
  2223  return NULL;
  2224  bio_list_add(>bio_list, bio);
  2225  /*
  2226   * This is a special bio which is used to hold the completion 
handler
  2227   * and make the scrub rbio is similar to the other types
  2228   */
  2229  ASSERT(!bio->bi_iter.bi_size);
  2230  rbio->operation = BTRFS_RBIO_PARITY_SCRUB;
  2231  
> 2232  for (i = rbio->data_stripes; i < rbio->real_stripes; i++) {
  2233  if (bbio->stripes[i].dev == scrub_dev) {
  2234  rbio->scrubp = i;
  2235  break;
  2236  }
  2237  }
  2238  ASSERT(i < rbio->real_stripes);
  2239  
  2240  /* Now we just support the sectorsize equals to page size */
  2241  ASSERT(fs_info->sectorsize == PAGE_SIZE);
  2242  ASSERT(rbio->stripe_npages == stripe_nsectors);
  2243  bitmap_copy(rbio->dbitmap, dbitmap, stripe_nsectors);
  2244  
  2245  /*
  2246   * We have already increased bio_counter when getting bbio, 
record it
  2247   * so we can free it at rbio_orig_end_io().
  2248   */
  2249  rbio->generic_bio_cnt = 1;
  2250  
  2251  return rbio;
  2252  }
  2253  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH] Btrfs: search parity device wisely

2017-08-03 Thread kbuild test robot
Hi Liu,

[auto build test ERROR on v4.13-rc3]
[also build test ERROR on next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Liu-Bo/Btrfs-search-parity-device-wisely/20170803-193103
config: x86_64-randconfig-x007-201731 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   fs/btrfs/raid56.c: In function 'raid56_parity_alloc_scrub_rbio':
>> fs/btrfs/raid56.c:2232:15: error: 'struct btrfs_raid_bio' has no member 
>> named 'data_stripes'; did you mean 'real_stripes'?
 for (i = rbio->data_stripes; i < rbio->real_stripes; i++) {
  ^~

vim +2232 fs/btrfs/raid56.c

  2201  
  2202  /*
  2203   * The following code is used to scrub/replace the parity stripe
  2204   *
  2205   * Caller must have already increased bio_counter for getting @bbio.
  2206   *
  2207   * Note: We need make sure all the pages that add into the scrub/replace
  2208   * raid bio are correct and not be changed during the scrub/replace. 
That
  2209   * is those pages just hold metadata or file data with checksum.
  2210   */
  2211  
  2212  struct btrfs_raid_bio *
  2213  raid56_parity_alloc_scrub_rbio(struct btrfs_fs_info *fs_info, struct 
bio *bio,
  2214 struct btrfs_bio *bbio, u64 stripe_len,
  2215 struct btrfs_device *scrub_dev,
  2216 unsigned long *dbitmap, int 
stripe_nsectors)
  2217  {
  2218  struct btrfs_raid_bio *rbio;
  2219  int i;
  2220  
  2221  rbio = alloc_rbio(fs_info, bbio, stripe_len);
    if (IS_ERR(rbio))
  2223  return NULL;
  2224  bio_list_add(>bio_list, bio);
  2225  /*
  2226   * This is a special bio which is used to hold the completion 
handler
  2227   * and make the scrub rbio is similar to the other types
  2228   */
  2229  ASSERT(!bio->bi_iter.bi_size);
  2230  rbio->operation = BTRFS_RBIO_PARITY_SCRUB;
  2231  
> 2232  for (i = rbio->data_stripes; i < rbio->real_stripes; i++) {
  2233  if (bbio->stripes[i].dev == scrub_dev) {
  2234  rbio->scrubp = i;
  2235  break;
  2236  }
  2237  }
  2238  ASSERT(i < rbio->real_stripes);
  2239  
  2240  /* Now we just support the sectorsize equals to page size */
  2241  ASSERT(fs_info->sectorsize == PAGE_SIZE);
  2242  ASSERT(rbio->stripe_npages == stripe_nsectors);
  2243  bitmap_copy(rbio->dbitmap, dbitmap, stripe_nsectors);
  2244  
  2245  /*
  2246   * We have already increased bio_counter when getting bbio, 
record it
  2247   * so we can free it at rbio_orig_end_io().
  2248   */
  2249  rbio->generic_bio_cnt = 1;
  2250  
  2251  return rbio;
  2252  }
  2253  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH] Btrfs: search parity device wisely

2017-08-02 Thread Liu Bo
After mapping block with BTRFS_MAP_WRITE, parities have been sorted to
the end position, so this search can start from the first parity
stripe.

Signed-off-by: Liu Bo 
---
 fs/btrfs/raid56.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index d8ea0eb..0c5ed68 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -2225,12 +2225,13 @@ raid56_parity_alloc_scrub_rbio(struct btrfs_fs_info 
*fs_info, struct bio *bio,
ASSERT(!bio->bi_iter.bi_size);
rbio->operation = BTRFS_RBIO_PARITY_SCRUB;
 
-   for (i = 0; i < rbio->real_stripes; i++) {
+   for (i = rbio->data_stripes; i < rbio->real_stripes; i++) {
if (bbio->stripes[i].dev == scrub_dev) {
rbio->scrubp = i;
break;
}
}
+   ASSERT(i < rbio->real_stripes);
 
/* Now we just support the sectorsize equals to page size */
ASSERT(fs_info->sectorsize == PAGE_SIZE);
-- 
2.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html