Loading drivers/block/rbd.c +1087 −686 File changed.Preview size limit exceeded, changes collapsed. Show changes fs/ceph/addr.c +3 −4 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max) CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ, NULL, 0, ci->i_truncate_seq, ci->i_truncate_size, NULL, false, 1, 0); NULL, false, 0); if (IS_ERR(req)) return PTR_ERR(req); Loading Loading @@ -492,8 +492,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) &ci->i_layout, snapc, page_off, len, ci->i_truncate_seq, ci->i_truncate_size, &inode->i_mtime, &page, 1, 0, 0, true); &inode->i_mtime, &page, 1); if (err < 0) { dout("writepage setting page/mapping error %d %p\n", err, page); SetPageError(page); Loading Loading @@ -838,7 +837,7 @@ get_more_pages: snapc, do_sync, ci->i_truncate_seq, ci->i_truncate_size, &inode->i_mtime, true, 1, 0); &inode->i_mtime, true, 0); if (IS_ERR(req)) { rc = PTR_ERR(req); Loading fs/ceph/caps.c +25 −7 Original line number Diff line number Diff line Loading @@ -611,8 +611,16 @@ retry: if (flags & CEPH_CAP_FLAG_AUTH) ci->i_auth_cap = cap; else if (ci->i_auth_cap == cap) else if (ci->i_auth_cap == cap) { ci->i_auth_cap = NULL; spin_lock(&mdsc->cap_dirty_lock); if (!list_empty(&ci->i_dirty_item)) { dout(" moving %p to cap_dirty_migrating\n", inode); list_move(&ci->i_dirty_item, &mdsc->cap_dirty_migrating); } spin_unlock(&mdsc->cap_dirty_lock); } dout("add_cap inode %p (%llx.%llx) cap %p %s now %s seq %d mds%d\n", inode, ceph_vinop(inode), cap, ceph_cap_string(issued), Loading Loading @@ -1460,7 +1468,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, struct ceph_mds_client *mdsc = fsc->mdsc; struct inode *inode = &ci->vfs_inode; struct ceph_cap *cap; int file_wanted, used; int file_wanted, used, cap_used; int took_snap_rwsem = 0; /* true if mdsc->snap_rwsem held */ int issued, implemented, want, retain, revoking, flushing = 0; int mds = -1; /* keep track of how far we've gone through i_caps list Loading Loading @@ -1563,9 +1571,14 @@ retry_locked: /* NOTE: no side-effects allowed, until we take s_mutex */ cap_used = used; if (ci->i_auth_cap && cap != ci->i_auth_cap) cap_used &= ~ci->i_auth_cap->issued; revoking = cap->implemented & ~cap->issued; dout(" mds%d cap %p issued %s implemented %s revoking %s\n", dout(" mds%d cap %p used %s issued %s implemented %s revoking %s\n", cap->mds, cap, ceph_cap_string(cap->issued), ceph_cap_string(cap_used), ceph_cap_string(cap->implemented), ceph_cap_string(revoking)); Loading Loading @@ -1593,7 +1606,7 @@ retry_locked: } /* completed revocation? going down and there are no caps? */ if (revoking && (revoking & used) == 0) { if (revoking && (revoking & cap_used) == 0) { dout("completed revocation of %s\n", ceph_cap_string(cap->implemented & ~cap->issued)); goto ack; Loading Loading @@ -1670,8 +1683,8 @@ ack: sent++; /* __send_cap drops i_ceph_lock */ delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, used, want, retain, flushing, NULL); delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, cap_used, want, retain, flushing, NULL); goto retry; /* retake i_ceph_lock and restart our cap scan. */ } Loading Loading @@ -2416,7 +2429,9 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, dout("mds wanted %s -> %s\n", ceph_cap_string(le32_to_cpu(grant->wanted)), ceph_cap_string(wanted)); grant->wanted = cpu_to_le32(wanted); /* imported cap may not have correct mds_wanted */ if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) check_caps = 1; } cap->seq = seq; Loading Loading @@ -2820,6 +2835,9 @@ void ceph_handle_caps(struct ceph_mds_session *session, dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, (unsigned)seq); if (op == CEPH_CAP_OP_IMPORT) ceph_add_cap_releases(mdsc, session); /* lookup ino */ inode = ceph_find_inode(sb, vino); ci = ceph_inode(inode); Loading fs/ceph/file.c +7 −1 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ? dir : NULL, req); if (err) goto out_err; err = ceph_handle_snapdir(req, dentry, err); if (err == 0 && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry) err = ceph_handle_notrace_create(dir, dentry); Loading @@ -263,6 +266,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, err = finish_no_open(file, dn); } else { dout("atomic_open finish_open on dn %p\n", dn); if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) { *opened |= FILE_CREATED; } err = finish_open(file, dentry, ceph_open, opened); } Loading Loading @@ -535,7 +541,7 @@ more: ci->i_snap_realm->cached_context, do_sync, ci->i_truncate_seq, ci->i_truncate_size, &mtime, false, 2, page_align); &mtime, false, page_align); if (IS_ERR(req)) return PTR_ERR(req); Loading fs/ceph/ioctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) return -EFAULT; down_read(&osdc->map_sem); r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, &len, r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, &dl.object_no, &dl.object_offset, &olen); if (r < 0) Loading Loading
drivers/block/rbd.c +1087 −686 File changed.Preview size limit exceeded, changes collapsed. Show changes
fs/ceph/addr.c +3 −4 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max) CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ, NULL, 0, ci->i_truncate_seq, ci->i_truncate_size, NULL, false, 1, 0); NULL, false, 0); if (IS_ERR(req)) return PTR_ERR(req); Loading Loading @@ -492,8 +492,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) &ci->i_layout, snapc, page_off, len, ci->i_truncate_seq, ci->i_truncate_size, &inode->i_mtime, &page, 1, 0, 0, true); &inode->i_mtime, &page, 1); if (err < 0) { dout("writepage setting page/mapping error %d %p\n", err, page); SetPageError(page); Loading Loading @@ -838,7 +837,7 @@ get_more_pages: snapc, do_sync, ci->i_truncate_seq, ci->i_truncate_size, &inode->i_mtime, true, 1, 0); &inode->i_mtime, true, 0); if (IS_ERR(req)) { rc = PTR_ERR(req); Loading
fs/ceph/caps.c +25 −7 Original line number Diff line number Diff line Loading @@ -611,8 +611,16 @@ retry: if (flags & CEPH_CAP_FLAG_AUTH) ci->i_auth_cap = cap; else if (ci->i_auth_cap == cap) else if (ci->i_auth_cap == cap) { ci->i_auth_cap = NULL; spin_lock(&mdsc->cap_dirty_lock); if (!list_empty(&ci->i_dirty_item)) { dout(" moving %p to cap_dirty_migrating\n", inode); list_move(&ci->i_dirty_item, &mdsc->cap_dirty_migrating); } spin_unlock(&mdsc->cap_dirty_lock); } dout("add_cap inode %p (%llx.%llx) cap %p %s now %s seq %d mds%d\n", inode, ceph_vinop(inode), cap, ceph_cap_string(issued), Loading Loading @@ -1460,7 +1468,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, struct ceph_mds_client *mdsc = fsc->mdsc; struct inode *inode = &ci->vfs_inode; struct ceph_cap *cap; int file_wanted, used; int file_wanted, used, cap_used; int took_snap_rwsem = 0; /* true if mdsc->snap_rwsem held */ int issued, implemented, want, retain, revoking, flushing = 0; int mds = -1; /* keep track of how far we've gone through i_caps list Loading Loading @@ -1563,9 +1571,14 @@ retry_locked: /* NOTE: no side-effects allowed, until we take s_mutex */ cap_used = used; if (ci->i_auth_cap && cap != ci->i_auth_cap) cap_used &= ~ci->i_auth_cap->issued; revoking = cap->implemented & ~cap->issued; dout(" mds%d cap %p issued %s implemented %s revoking %s\n", dout(" mds%d cap %p used %s issued %s implemented %s revoking %s\n", cap->mds, cap, ceph_cap_string(cap->issued), ceph_cap_string(cap_used), ceph_cap_string(cap->implemented), ceph_cap_string(revoking)); Loading Loading @@ -1593,7 +1606,7 @@ retry_locked: } /* completed revocation? going down and there are no caps? */ if (revoking && (revoking & used) == 0) { if (revoking && (revoking & cap_used) == 0) { dout("completed revocation of %s\n", ceph_cap_string(cap->implemented & ~cap->issued)); goto ack; Loading Loading @@ -1670,8 +1683,8 @@ ack: sent++; /* __send_cap drops i_ceph_lock */ delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, used, want, retain, flushing, NULL); delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, cap_used, want, retain, flushing, NULL); goto retry; /* retake i_ceph_lock and restart our cap scan. */ } Loading Loading @@ -2416,7 +2429,9 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, dout("mds wanted %s -> %s\n", ceph_cap_string(le32_to_cpu(grant->wanted)), ceph_cap_string(wanted)); grant->wanted = cpu_to_le32(wanted); /* imported cap may not have correct mds_wanted */ if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) check_caps = 1; } cap->seq = seq; Loading Loading @@ -2820,6 +2835,9 @@ void ceph_handle_caps(struct ceph_mds_session *session, dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, (unsigned)seq); if (op == CEPH_CAP_OP_IMPORT) ceph_add_cap_releases(mdsc, session); /* lookup ino */ inode = ceph_find_inode(sb, vino); ci = ceph_inode(inode); Loading
fs/ceph/file.c +7 −1 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ? dir : NULL, req); if (err) goto out_err; err = ceph_handle_snapdir(req, dentry, err); if (err == 0 && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry) err = ceph_handle_notrace_create(dir, dentry); Loading @@ -263,6 +266,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, err = finish_no_open(file, dn); } else { dout("atomic_open finish_open on dn %p\n", dn); if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) { *opened |= FILE_CREATED; } err = finish_open(file, dentry, ceph_open, opened); } Loading Loading @@ -535,7 +541,7 @@ more: ci->i_snap_realm->cached_context, do_sync, ci->i_truncate_seq, ci->i_truncate_size, &mtime, false, 2, page_align); &mtime, false, page_align); if (IS_ERR(req)) return PTR_ERR(req); Loading
fs/ceph/ioctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) return -EFAULT; down_read(&osdc->map_sem); r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, &len, r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, &dl.object_no, &dl.object_offset, &olen); if (r < 0) Loading