Skip to content

Commit 00e3f5c

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull Ceph updates from Sage Weil: "The two main changes are aio support in CephFS, and a series that fixes several issues in the authentication key timeout/renewal code. On top of that are a variety of cleanups and minor bug fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: libceph: remove outdated comment libceph: kill off ceph_x_ticket_handler::validity libceph: invalidate AUTH in addition to a service ticket libceph: fix authorizer invalidation, take 2 libceph: clear messenger auth_retry flag if we fault libceph: fix ceph_msg_revoke() libceph: use list_for_each_entry_safe ceph: use i_size_{read,write} to get/set i_size ceph: re-send AIO write request when getting -EOLDSNAP error ceph: Asynchronous IO support ceph: Avoid to propagate the invalid page point ceph: fix double page_unlock() in page_mkwrite() rbd: delete an unnecessary check before rbd_dev_destroy() libceph: use list_next_entry instead of list_entry_next ceph: ceph_frag_contains_value can be boolean ceph: remove unused functions in ceph_frag.h
2 parents 772950e + 7e01726 commit 00e3f5c

File tree

11 files changed

+501
-240
lines changed

11 files changed

+501
-240
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5185,8 +5185,7 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
51855185

51865186
out_err:
51875187
rbd_dev_unparent(rbd_dev);
5188-
if (parent)
5189-
rbd_dev_destroy(parent);
5188+
rbd_dev_destroy(parent);
51905189
return ret;
51915190
}
51925191

fs/ceph/addr.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ static int ceph_update_writeable_page(struct file *file,
11081108
return 0;
11091109

11101110
/* past end of file? */
1111-
i_size = inode->i_size; /* caller holds i_mutex */
1111+
i_size = i_size_read(inode);
11121112

11131113
if (page_off >= i_size ||
11141114
(pos_in_page == 0 && (pos+len) >= i_size &&
@@ -1149,7 +1149,6 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
11491149
page = grab_cache_page_write_begin(mapping, index, 0);
11501150
if (!page)
11511151
return -ENOMEM;
1152-
*pagep = page;
11531152

11541153
dout("write_begin file %p inode %p page %p %d~%d\n", file,
11551154
inode, page, (int)pos, (int)len);
@@ -1184,8 +1183,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
11841183
zero_user_segment(page, from+copied, len);
11851184

11861185
/* did file size increase? */
1187-
/* (no need for i_size_read(); we caller holds i_mutex */
1188-
if (pos+copied > inode->i_size)
1186+
if (pos+copied > i_size_read(inode))
11891187
check_cap = ceph_inode_set_size(inode, pos+copied);
11901188

11911189
if (!PageUptodate(page))
@@ -1378,11 +1376,13 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
13781376

13791377
ret = VM_FAULT_NOPAGE;
13801378
if ((off > size) ||
1381-
(page->mapping != inode->i_mapping))
1379+
(page->mapping != inode->i_mapping)) {
1380+
unlock_page(page);
13821381
goto out;
1382+
}
13831383

13841384
ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
1385-
if (ret == 0) {
1385+
if (ret >= 0) {
13861386
/* success. we'll keep the page locked. */
13871387
set_page_dirty(page);
13881388
ret = VM_FAULT_LOCKED;
@@ -1393,8 +1393,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
13931393
ret = VM_FAULT_SIGBUS;
13941394
}
13951395
out:
1396-
if (ret != VM_FAULT_LOCKED)
1397-
unlock_page(page);
13981396
if (ret == VM_FAULT_LOCKED ||
13991397
ci->i_inline_version != CEPH_INLINE_NONE) {
14001398
int dirty;

fs/ceph/cache.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static uint16_t ceph_fscache_inode_get_aux(const void *cookie_netfs_data,
106106

107107
memset(&aux, 0, sizeof(aux));
108108
aux.mtime = inode->i_mtime;
109-
aux.size = inode->i_size;
109+
aux.size = i_size_read(inode);
110110

111111
memcpy(buffer, &aux, sizeof(aux));
112112

@@ -117,9 +117,7 @@ static void ceph_fscache_inode_get_attr(const void *cookie_netfs_data,
117117
uint64_t *size)
118118
{
119119
const struct ceph_inode_info* ci = cookie_netfs_data;
120-
const struct inode* inode = &ci->vfs_inode;
121-
122-
*size = inode->i_size;
120+
*size = i_size_read(&ci->vfs_inode);
123121
}
124122

125123
static enum fscache_checkaux ceph_fscache_inode_check_aux(
@@ -134,7 +132,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(
134132

135133
memset(&aux, 0, sizeof(aux));
136134
aux.mtime = inode->i_mtime;
137-
aux.size = inode->i_size;
135+
aux.size = i_size_read(inode);
138136

139137
if (memcmp(data, &aux, sizeof(aux)) != 0)
140138
return FSCACHE_CHECKAUX_OBSOLETE;

0 commit comments

Comments
 (0)