Commit 9f2d8be4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  nilfs2: fix disorder in cp count on error during deleting checkpoints
  nilfs2: fix lockdep warning between regular file and inode file
  nilfs2: fix incorrect KERN_CRIT messages in case of write failures
  nilfs2: fix hang problem of log writer which occurs after write failures
  nilfs2: remove unlikely directive causing mis-conversion of error code
parents ac3f4822 d9a0a345
...@@ -568,6 +568,7 @@ void nilfs_bmap_abort_update_v(struct nilfs_bmap *bmap, ...@@ -568,6 +568,7 @@ void nilfs_bmap_abort_update_v(struct nilfs_bmap *bmap,
} }
static struct lock_class_key nilfs_bmap_dat_lock_key; static struct lock_class_key nilfs_bmap_dat_lock_key;
static struct lock_class_key nilfs_bmap_mdt_lock_key;
/** /**
* nilfs_bmap_read - read a bmap from an inode * nilfs_bmap_read - read a bmap from an inode
...@@ -603,7 +604,11 @@ int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode) ...@@ -603,7 +604,11 @@ int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode)
bmap->b_ptr_type = NILFS_BMAP_PTR_VS; bmap->b_ptr_type = NILFS_BMAP_PTR_VS;
bmap->b_last_allocated_key = 0; bmap->b_last_allocated_key = 0;
bmap->b_last_allocated_ptr = NILFS_BMAP_INVALID_PTR; bmap->b_last_allocated_ptr = NILFS_BMAP_INVALID_PTR;
lockdep_set_class(&bmap->b_sem, &nilfs_bmap_mdt_lock_key);
break; break;
case NILFS_IFILE_INO:
lockdep_set_class(&bmap->b_sem, &nilfs_bmap_mdt_lock_key);
/* Fall through */
default: default:
bmap->b_ptr_type = NILFS_BMAP_PTR_VM; bmap->b_ptr_type = NILFS_BMAP_PTR_VM;
bmap->b_last_allocated_key = 0; bmap->b_last_allocated_key = 0;
......
...@@ -307,7 +307,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile, ...@@ -307,7 +307,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh); ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh);
if (ret < 0) { if (ret < 0) {
if (ret != -ENOENT) if (ret != -ENOENT)
goto out_header; break;
/* skip hole */ /* skip hole */
ret = 0; ret = 0;
continue; continue;
...@@ -340,7 +340,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile, ...@@ -340,7 +340,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
continue; continue;
printk(KERN_ERR "%s: cannot delete block\n", printk(KERN_ERR "%s: cannot delete block\n",
__func__); __func__);
goto out_header; break;
} }
} }
...@@ -358,7 +358,6 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile, ...@@ -358,7 +358,6 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
kunmap_atomic(kaddr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
} }
out_header:
brelse(header_bh); brelse(header_bh);
out_sem: out_sem:
......
...@@ -134,15 +134,6 @@ void nilfs_dat_commit_start(struct inode *dat, struct nilfs_palloc_req *req, ...@@ -134,15 +134,6 @@ void nilfs_dat_commit_start(struct inode *dat, struct nilfs_palloc_req *req,
entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr, entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr,
req->pr_entry_bh, kaddr); req->pr_entry_bh, kaddr);
entry->de_start = cpu_to_le64(nilfs_mdt_cno(dat)); entry->de_start = cpu_to_le64(nilfs_mdt_cno(dat));
if (entry->de_blocknr != cpu_to_le64(0) ||
entry->de_end != cpu_to_le64(NILFS_CNO_MAX)) {
printk(KERN_CRIT
"%s: vbn = %llu, start = %llu, end = %llu, pbn = %llu\n",
__func__, (unsigned long long)req->pr_entry_nr,
(unsigned long long)le64_to_cpu(entry->de_start),
(unsigned long long)le64_to_cpu(entry->de_end),
(unsigned long long)le64_to_cpu(entry->de_blocknr));
}
entry->de_blocknr = cpu_to_le64(blocknr); entry->de_blocknr = cpu_to_le64(blocknr);
kunmap_atomic(kaddr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
......
...@@ -1829,26 +1829,13 @@ static int nilfs_segctor_write(struct nilfs_sc_info *sci, ...@@ -1829,26 +1829,13 @@ static int nilfs_segctor_write(struct nilfs_sc_info *sci,
err = nilfs_segbuf_write(segbuf, &wi); err = nilfs_segbuf_write(segbuf, &wi);
res = nilfs_segbuf_wait(segbuf, &wi); res = nilfs_segbuf_wait(segbuf, &wi);
err = unlikely(err) ? : res; err = err ? : res;
if (unlikely(err)) if (err)
return err; return err;
} }
return 0; return 0;
} }
static int nilfs_page_has_uncleared_buffer(struct page *page)
{
struct buffer_head *head, *bh;
head = bh = page_buffers(page);
do {
if (buffer_dirty(bh) && !list_empty(&bh->b_assoc_buffers))
return 1;
bh = bh->b_this_page;
} while (bh != head);
return 0;
}
static void __nilfs_end_page_io(struct page *page, int err) static void __nilfs_end_page_io(struct page *page, int err)
{ {
if (!err) { if (!err) {
...@@ -1872,12 +1859,11 @@ static void nilfs_end_page_io(struct page *page, int err) ...@@ -1872,12 +1859,11 @@ static void nilfs_end_page_io(struct page *page, int err)
if (!page) if (!page)
return; return;
if (buffer_nilfs_node(page_buffers(page)) && if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page))
nilfs_page_has_uncleared_buffer(page)) /*
/* For b-tree node pages, this function may be called twice * For b-tree node pages, this function may be called twice
or more because they might be split in a segment. * or more because they might be split in a segment.
This check assures that cleanup has been done for all */
buffers in a split btnode page. */
return; return;
__nilfs_end_page_io(page, err); __nilfs_end_page_io(page, err);
...@@ -1940,7 +1926,7 @@ static void nilfs_segctor_abort_write(struct nilfs_sc_info *sci, ...@@ -1940,7 +1926,7 @@ static void nilfs_segctor_abort_write(struct nilfs_sc_info *sci,
} }
if (bh->b_page != fs_page) { if (bh->b_page != fs_page) {
nilfs_end_page_io(fs_page, err); nilfs_end_page_io(fs_page, err);
if (unlikely(fs_page == failed_page)) if (fs_page && fs_page == failed_page)
goto done; goto done;
fs_page = bh->b_page; fs_page = bh->b_page;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment