Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Jan 24, 2016
2 parents 772950e + 7e01726 commit 00e3f5c
Show file tree
Hide file tree
Showing 11 changed files with 501 additions and 240 deletions.
3 changes: 1 addition & 2 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5185,8 +5185,7 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)

out_err:
rbd_dev_unparent(rbd_dev);
if (parent)
rbd_dev_destroy(parent);
rbd_dev_destroy(parent);
return ret;
}

Expand Down
14 changes: 6 additions & 8 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ static int ceph_update_writeable_page(struct file *file,
return 0;

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

if (page_off >= i_size ||
(pos_in_page == 0 && (pos+len) >= i_size &&
Expand Down Expand Up @@ -1149,7 +1149,6 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
page = grab_cache_page_write_begin(mapping, index, 0);
if (!page)
return -ENOMEM;
*pagep = page;

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

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

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

ret = VM_FAULT_NOPAGE;
if ((off > size) ||
(page->mapping != inode->i_mapping))
(page->mapping != inode->i_mapping)) {
unlock_page(page);
goto out;
}

ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
if (ret == 0) {
if (ret >= 0) {
/* success. we'll keep the page locked. */
set_page_dirty(page);
ret = VM_FAULT_LOCKED;
Expand All @@ -1393,8 +1393,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = VM_FAULT_SIGBUS;
}
out:
if (ret != VM_FAULT_LOCKED)
unlock_page(page);
if (ret == VM_FAULT_LOCKED ||
ci->i_inline_version != CEPH_INLINE_NONE) {
int dirty;
Expand Down
8 changes: 3 additions & 5 deletions fs/ceph/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static uint16_t ceph_fscache_inode_get_aux(const void *cookie_netfs_data,

memset(&aux, 0, sizeof(aux));
aux.mtime = inode->i_mtime;
aux.size = inode->i_size;
aux.size = i_size_read(inode);

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

Expand All @@ -117,9 +117,7 @@ static void ceph_fscache_inode_get_attr(const void *cookie_netfs_data,
uint64_t *size)
{
const struct ceph_inode_info* ci = cookie_netfs_data;
const struct inode* inode = &ci->vfs_inode;

*size = inode->i_size;
*size = i_size_read(&ci->vfs_inode);
}

static enum fscache_checkaux ceph_fscache_inode_check_aux(
Expand All @@ -134,7 +132,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(

memset(&aux, 0, sizeof(aux));
aux.mtime = inode->i_mtime;
aux.size = inode->i_size;
aux.size = i_size_read(inode);

if (memcmp(data, &aux, sizeof(aux)) != 0)
return FSCACHE_CHECKAUX_OBSOLETE;
Expand Down
Loading

0 comments on commit 00e3f5c

Please sign in to comment.