Commit 54ad023b authored by Sage Weil's avatar Sage Weil

ceph: don't use writeback_control in writepages completion

The ->writepages writeback_control is not still valid in the writepages
completion.  We were touching it solely to adjust pages_skipped when there
was a writeback error (EIO, ENOSPC, EPERM due to bad osd credentials),
causing an oops in the writeback code shortly thereafter.  Updating
pages_skipped on error isn't correct anyway, so let's just rip out this
(clearly broken) code to pass the wbc to the completion.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 5dfc589a
...@@ -504,7 +504,6 @@ static void writepages_finish(struct ceph_osd_request *req, ...@@ -504,7 +504,6 @@ static void writepages_finish(struct ceph_osd_request *req,
int i; int i;
struct ceph_snap_context *snapc = req->r_snapc; struct ceph_snap_context *snapc = req->r_snapc;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct writeback_control *wbc = req->r_wbc;
__s32 rc = -EIO; __s32 rc = -EIO;
u64 bytes = 0; u64 bytes = 0;
struct ceph_client *client = ceph_inode_to_client(inode); struct ceph_client *client = ceph_inode_to_client(inode);
...@@ -546,10 +545,6 @@ static void writepages_finish(struct ceph_osd_request *req, ...@@ -546,10 +545,6 @@ static void writepages_finish(struct ceph_osd_request *req,
clear_bdi_congested(&client->backing_dev_info, clear_bdi_congested(&client->backing_dev_info,
BLK_RW_ASYNC); BLK_RW_ASYNC);
if (i >= wrote) {
dout("inode %p skipping page %p\n", inode, page);
wbc->pages_skipped++;
}
ceph_put_snap_context((void *)page->private); ceph_put_snap_context((void *)page->private);
page->private = 0; page->private = 0;
ClearPagePrivate(page); ClearPagePrivate(page);
...@@ -799,7 +794,6 @@ get_more_pages: ...@@ -799,7 +794,6 @@ get_more_pages:
alloc_page_vec(client, req); alloc_page_vec(client, req);
req->r_callback = writepages_finish; req->r_callback = writepages_finish;
req->r_inode = inode; req->r_inode = inode;
req->r_wbc = wbc;
} }
/* note position of first page in pvec */ /* note position of first page in pvec */
......
...@@ -66,7 +66,6 @@ struct ceph_osd_request { ...@@ -66,7 +66,6 @@ struct ceph_osd_request {
struct list_head r_unsafe_item; struct list_head r_unsafe_item;
struct inode *r_inode; /* for use by callbacks */ struct inode *r_inode; /* for use by callbacks */
struct writeback_control *r_wbc; /* ditto */
char r_oid[40]; /* object name */ char r_oid[40]; /* object name */
int r_oid_len; int r_oid_len;
......
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