Skip to content

Commit 87bc5b8

Browse files
ukernelidryomov
authored andcommitted
ceph: use ceph_evict_inode to cleanup inode's resource
remove_session_caps() relies on __wait_on_freeing_inode(), to wait for freeing inode to remove its caps. But VFS wakes freeing inode waiters before calling destroy_inode(). Cc: [email protected] Link: https://tracker.ceph.com/issues/40102 Signed-off-by: "Yan, Zheng" <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 0f7cf80 commit 87bc5b8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

fs/ceph/inode.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,16 @@ void ceph_free_inode(struct inode *inode)
526526
kmem_cache_free(ceph_inode_cachep, ci);
527527
}
528528

529-
void ceph_destroy_inode(struct inode *inode)
529+
void ceph_evict_inode(struct inode *inode)
530530
{
531531
struct ceph_inode_info *ci = ceph_inode(inode);
532532
struct ceph_inode_frag *frag;
533533
struct rb_node *n;
534534

535-
dout("destroy_inode %p ino %llx.%llx\n", inode, ceph_vinop(inode));
535+
dout("evict_inode %p ino %llx.%llx\n", inode, ceph_vinop(inode));
536+
537+
truncate_inode_pages_final(&inode->i_data);
538+
clear_inode(inode);
536539

537540
ceph_fscache_unregister_inode_cookie(ci);
538541

fs/ceph/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,10 @@ static int ceph_remount(struct super_block *sb, int *flags, char *data)
840840

841841
static const struct super_operations ceph_super_ops = {
842842
.alloc_inode = ceph_alloc_inode,
843-
.destroy_inode = ceph_destroy_inode,
844843
.free_inode = ceph_free_inode,
845844
.write_inode = ceph_write_inode,
846845
.drop_inode = ceph_drop_inode,
846+
.evict_inode = ceph_evict_inode,
847847
.sync_fs = ceph_sync_fs,
848848
.put_super = ceph_put_super,
849849
.remount_fs = ceph_remount,

fs/ceph/super.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ static inline bool __ceph_have_pending_cap_snap(struct ceph_inode_info *ci)
884884
extern const struct inode_operations ceph_file_iops;
885885

886886
extern struct inode *ceph_alloc_inode(struct super_block *sb);
887-
extern void ceph_destroy_inode(struct inode *inode);
887+
extern void ceph_evict_inode(struct inode *inode);
888888
extern void ceph_free_inode(struct inode *inode);
889889
extern int ceph_drop_inode(struct inode *inode);
890890

0 commit comments

Comments
 (0)