linux/fs/btrfs
Liu Bo fa6ac8765c Btrfs: fix cleaner thread not working with inode cache option
Right now inode cache inode is treated as the same as space cache
inode, ie. keep inode in memory till putting super.

But this leads to an awkward situation.

If we're going to delete a snapshot/subvolume, btrfs will not
actually delete it and return free space, but will add it to dead
roots list until the last inode on this snap/subvol being destroyed.
Then we'll fetch deleted roots and cleanup them via cleaner thread.

So here is the problem, if we enable inode cache option, each
snap/subvol has a cached inode which is used to store inode allcation
information.  And this cache inode will be kept in memory, as the above
said.  So with inode cache, snap/subvol can only be added into
dead roots list during freeing roots stage in umount, so that we can
ONLY get space back after another remount(we cleanup dead roots on mount).

But the real thing is we'll no more use the snap/subvol if we mark it
deleted, so we can safely iput its cache inode when we delete snap/subvol.

Another thing is that we need to change the rules of droping inode, we
don't keep snap/subvol's cache inode in memory till end so that we can
add snap/subvol into dead roots list in time.

Reported-by: Mitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
2013-02-20 13:00:06 -05:00
..
Kconfig
Makefile Btrfs: add new sources for device replace code 2012-12-12 17:15:41 -05:00
acl.c Btrfs: skip adding an acl attribute if we don't have to 2012-12-16 20:46:15 -05:00
async-thread.c
async-thread.h
backref.c Btrfs: merge inode_list in __merge_refs 2012-12-12 17:15:27 -05:00
backref.h Btrfs: move fs/btrfs/ioctl.h to include/uapi/linux/btrfs.h 2013-02-20 09:37:28 -05:00
btrfs_inode.h Btrfs: serialize unlocked dio reads with truncate 2013-02-20 12:59:47 -05:00
check-integrity.c btrfs: define BTRFS_MAGIC as a u64 value 2013-02-20 13:00:01 -05:00
check-integrity.h
compat.h
compression.c Btrfs: handle errors from btrfs_map_bio() everywhere 2012-12-12 17:15:40 -05:00
compression.h
ctree.c btrfs: remove cache only arguments from defrag path 2013-02-20 12:59:36 -05:00
ctree.h btrfs: define BTRFS_MAGIC as a u64 value 2013-02-20 13:00:01 -05:00
delayed-inode.c btrfs: remove unused "item" in btrfs_insert_delayed_item() 2013-02-20 12:59:23 -05:00
delayed-inode.h Btrfs: fix lots of orphan inodes when the space is not enough 2013-02-20 09:36:39 -05:00
delayed-ref.c Btrfs: make delayed ref lock logic more readable 2013-02-20 09:36:41 -05:00
delayed-ref.h Btrfs: make delayed ref lock logic more readable 2013-02-20 09:36:41 -05:00
dev-replace.c Btrfs: check the return value of btrfs_start_delalloc_inodes() 2013-02-20 09:37:21 -05:00
dev-replace.h Btrfs: add new sources for device replace code 2012-12-12 17:15:41 -05:00
dir-item.c Btrfs: fix hash overflow handling 2012-12-17 14:48:21 -05:00
disk-io.c btrfs: define BTRFS_MAGIC as a u64 value 2013-02-20 13:00:01 -05:00
disk-io.h Btrfs: cleanup for btrfs_btree_balance_dirty 2012-12-12 17:15:28 -05:00
export.c
export.h
extent-tree.c btrfs: put some enospc messages under enospc_debug 2013-02-20 12:59:49 -05:00
extent_io.c Btrfs: remove unused extent io tree ops V2 2013-02-20 12:59:52 -05:00
extent_io.h Btrfs: remove unused extent io tree ops V2 2013-02-20 12:59:52 -05:00
extent_map.c Btrfs: do not merge logged extents if we've removed them from the tree 2013-02-05 16:09:03 -05:00
extent_map.h Btrfs: do not allow logged extents to be merged or removed 2013-01-24 12:49:48 -05:00
file-item.c Btrfs: extend the checksum item as much as possible 2013-02-20 12:59:37 -05:00
file.c Btrfs: place ordered operations on a per transaction list 2013-02-20 12:59:57 -05:00
free-space-cache.c Btrfs: relax the block group size limit for bitmaps 2013-02-20 12:59:55 -05:00
free-space-cache.h
hash.h btrfs: extended inode refs 2012-10-09 09:14:45 -04:00
inode-item.c btrfs: extended inode refs 2012-10-09 09:14:45 -04:00
inode-map.c Btrfs: improve the noflush reservation 2012-12-11 13:31:31 -05:00
inode-map.h
inode.c Btrfs: fix cleaner thread not working with inode cache option 2013-02-20 13:00:06 -05:00
ioctl.c Btrfs: fix cleaner thread not working with inode cache option 2013-02-20 13:00:06 -05:00
locking.c Btrfs: save us a read_lock 2013-02-20 09:37:17 -05:00
locking.h
lzo.c
math.h Btrfs: cleanup duplicated division functions 2012-12-11 13:31:30 -05:00
ordered-data.c Btrfs: place ordered operations on a per transaction list 2013-02-20 12:59:57 -05:00
ordered-data.h Btrfs: place ordered operations on a per transaction list 2013-02-20 12:59:57 -05:00
orphan.c
print-tree.c btrfs: add missing break in btrfs_print_leaf() 2013-02-20 12:59:20 -05:00
print-tree.h
qgroup.c Btrfs: move fs/btrfs/ioctl.h to include/uapi/linux/btrfs.h 2013-02-20 09:37:28 -05:00
rcu-string.h
reada.c Btrfs: introduce GET_READ_MIRRORS functionality for btrfs_map_block() 2012-12-12 17:15:43 -05:00
relocation.c Btrfs: use wrapper page_offset 2013-02-20 09:36:43 -05:00
root-tree.c Btrfs: rename root_times_lock to root_item_lock 2012-12-16 20:46:21 -05:00
scrub.c Btrfs: use bit operation for ->fs_state 2013-02-20 12:59:09 -05:00
send.c btrfs: add "no file data" flag to btrfs send ioctl 2013-02-20 12:59:39 -05:00
send.h btrfs: add "no file data" flag to btrfs send ioctl 2013-02-20 12:59:39 -05:00
struct-funcs.c
super.c Btrfs: fix uncompleted transaction 2013-02-20 13:00:05 -05:00
sysfs.c
transaction.c Btrfs: fix uncompleted transaction 2013-02-20 13:00:05 -05:00
transaction.h Btrfs: fix uncompleted transaction 2013-02-20 13:00:05 -05:00
tree-defrag.c btrfs: remove cache only arguments from defrag path 2013-02-20 12:59:36 -05:00
tree-log.c btrfs: remove cache only arguments from defrag path 2013-02-20 12:59:36 -05:00
tree-log.h
ulist.c Btrfs: make aux field of ulist 64 bit 2012-10-01 15:18:53 -04:00
ulist.h Btrfs: make aux field of ulist 64 bit 2012-10-01 15:18:53 -04:00
version.h
volumes.c btrfs: define BTRFS_MAGIC as a u64 value 2013-02-20 13:00:01 -05:00
volumes.h Btrfs: move fs/btrfs/ioctl.h to include/uapi/linux/btrfs.h 2013-02-20 09:37:28 -05:00
xattr.c Btrfs: only log the inode item if we can get away with it 2012-12-16 20:46:21 -05:00
xattr.h
zlib.c btrfs: fix message printing 2012-10-09 09:19:57 -04:00