mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
ceph: fix un-balanced fsc->writeback_count update
Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
5d98830828
commit
314c4737a4
1 changed files with 6 additions and 3 deletions
|
@ -578,7 +578,6 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
|
||||||
struct ceph_fs_client *fsc;
|
struct ceph_fs_client *fsc;
|
||||||
struct ceph_snap_context *snapc, *oldest;
|
struct ceph_snap_context *snapc, *oldest;
|
||||||
loff_t page_off = page_offset(page);
|
loff_t page_off = page_offset(page);
|
||||||
long writeback_stat;
|
|
||||||
int err, len = PAGE_SIZE;
|
int err, len = PAGE_SIZE;
|
||||||
struct ceph_writeback_ctl ceph_wbc;
|
struct ceph_writeback_ctl ceph_wbc;
|
||||||
|
|
||||||
|
@ -619,8 +618,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
|
||||||
dout("writepage %p page %p index %lu on %llu~%u snapc %p seq %lld\n",
|
dout("writepage %p page %p index %lu on %llu~%u snapc %p seq %lld\n",
|
||||||
inode, page, page->index, page_off, len, snapc, snapc->seq);
|
inode, page, page->index, page_off, len, snapc, snapc->seq);
|
||||||
|
|
||||||
writeback_stat = atomic_long_inc_return(&fsc->writeback_count);
|
if (atomic_long_inc_return(&fsc->writeback_count) >
|
||||||
if (writeback_stat >
|
|
||||||
CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
|
CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
|
||||||
set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
|
set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
|
||||||
|
|
||||||
|
@ -655,6 +653,11 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
|
||||||
end_page_writeback(page);
|
end_page_writeback(page);
|
||||||
ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
|
ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
|
||||||
ceph_put_snap_context(snapc); /* page's reference */
|
ceph_put_snap_context(snapc); /* page's reference */
|
||||||
|
|
||||||
|
if (atomic_long_dec_return(&fsc->writeback_count) <
|
||||||
|
CONGESTION_OFF_THRESH(fsc->mount_options->congestion_kb))
|
||||||
|
clear_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue