linux/fs
Josef Bacik 77cef2ec54 Btrfs: allow partial ordered extent completion
We currently have this problem where you can truncate pages that have not yet
been written for an ordered extent.  We do this because the truncate will be
coming behind to clean us up anyway so what's the harm right?  Well if truncate
fails for whatever reason we leave an orphan item around for the file to be
cleaned up later.  But if the user goes and truncates up the file and tries to
read from the area that had been discarded previously they will get a csum error
because we never actually wrote that data out.

This patch fixes this by allowing us to either discard the ordered extent
completely, by which I mean we just free up the space we had allocated and not
add the file extent, or adjust the length of the file extent we write.  We do
this by setting the length we truncated down to in the ordered extent, and then
we set the file extent length and ram bytes to this length.  The total disk
space stays unchanged since we may be compressed and we can't just chop off the
disk space, but at least this way the file extent only points to the valid data.
Then when the file extent is free'd the extent and csums will be freed normally.

This patch is needed for the next series which will give us more graceful
recovery of failed truncates.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-09-01 08:16:34 -04:00
..
9p Second round of 9p patches for the 3.11 merge window. 2013-07-11 10:21:23 -07:00
adfs
affs
afs
autofs4
befs
bfs bfs: iget_locked() doesn't return an ERR_PTR 2013-08-24 12:10:22 -04:00
btrfs Btrfs: allow partial ordered extent completion 2013-09-01 08:16:34 -04:00
cachefiles
ceph Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-07-09 12:39:10 -07:00
cifs cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately 2013-08-07 10:57:06 -05:00
coda
configfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-14 11:42:26 -07:00
cramfs
debugfs debugfs: debugfs_remove_recursive() must not rely on list_empty(d_subdirs) 2013-07-31 12:16:31 -04:00
devpts
dlm dlm: kill the unnecessary and wrong device_close()->recalc_sigpending() 2013-08-09 10:48:20 -07:00
ecryptfs Code cleanups and improved buffer handling during page crypto operations 2013-07-11 10:20:18 -07:00
efivarfs efivarfs: we can use simple_lookup() now 2013-07-14 17:48:35 +04:00
efs efs: iget_locked() doesn't return an ERR_PTR() 2013-08-24 12:10:22 -04:00
exofs
exportfs
ext2
ext3 ext3: fix a BUG when opening a file with O_TMPFILE flag 2013-07-20 22:03:20 -04:00
ext4 jbd2: Fix oops in jbd2_journal_file_inode() 2013-08-16 21:19:41 -04:00
f2fs
fat fatfs: add FAT_IOCTL_GET_VOLUME_ID 2013-07-09 10:33:25 -07:00
freevxfs
fscache
fuse fuse: readdirplus: cleanup 2013-07-17 14:53:54 +02:00
gfs2 GFS2: Check for glock already held in gfs2_getxattr 2013-08-19 09:33:57 +01:00
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs cope with potentially long ->d_dname() output for shmem/hugetlb 2013-08-24 12:10:17 -04:00
isofs
jbd
jbd2
jffs2
jfs A couple cleanups to JFS for 3.11 2013-07-11 10:19:34 -07:00
lockd LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-05 15:03:46 -04:00
logfs
minix
ncpfs ncpfs: fix error return code in ncp_parse_options() 2013-07-09 10:33:25 -07:00
nfs NFSv4: Fix up nfs4_proc_lookup_mountpoint 2013-08-07 20:47:26 -04:00
nfs_common
nfsd nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID 2013-08-07 12:06:07 -04:00
nilfs2 nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection 2013-08-23 09:51:22 -07:00
nls
notify
ntfs
ocfs2 ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id() 2013-08-13 17:57:49 -07:00
omfs
openpromfs
proc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-08-25 12:25:38 -07:00
pstore
qnx4
qnx6
quota
ramfs
reiserfs reiserfs: fix deadlock in umount 2013-08-05 17:37:37 +04:00
romfs
squashfs
sysfs sysfs: prevent warning when only using binary attributes 2013-07-16 10:57:36 -07:00
sysv
ubifs
udf
ufs
xfs xfs: di_flushiter considered harmful 2013-07-25 10:41:42 -05:00
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c mm: remove free_area_cache 2013-07-10 18:11:34 -07:00
binfmt_elf.c mm: remove free_area_cache 2013-07-10 18:11:34 -07:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal 2013-08-21 10:58:35 -07:00
block_dev.c Merge branch 'for-3.11/core' of git://git.kernel.dk/linux-block 2013-07-11 13:03:24 -07:00
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
coredump.c
coredump.h
dcache.c cope with potentially long ->d_dname() output for shmem/hugetlb 2013-08-24 12:10:17 -04:00
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c Fix TLB gather virtual address range invalidation corner cases 2013-08-16 08:52:46 -07:00
fcntl.c vfs: add missing check for __O_TMPFILE in fcntl_init() 2013-08-05 18:25:32 +04:00
fhandle.c
file.c
file_table.c fput: turn "list_head delayed_fput_list" into llist_head 2013-07-13 13:29:10 +04:00
filesystems.c
fs-writeback.c mm/writeback: don't check force_wait to handle bdi->work_list 2013-07-09 10:33:22 -07:00
fs_struct.c
generic_acl.c
inode.c
internal.h
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c make simple_lookup() usable for filesystems that set ->s_d_op 2013-07-14 17:43:25 +04:00
locks.c
Makefile
mbcache.c
mount.h
mpage.c
namei.c fs: Allow unprivileged linkat(..., AT_EMPTY_PATH) aka flink 2013-08-05 18:24:11 +04:00
namespace.c VFS: collect_mounts() should return an ERR_PTR 2013-08-24 12:10:29 -04:00
no-block.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
open.c fs: Fix file mode for O_TMPFILE 2013-08-05 18:24:10 +04:00
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
select.c net: rename include/net/ll_poll.h to include/net/busy_poll.h 2013-07-10 17:08:27 -07:00
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c livelock avoidance in sget() 2013-07-20 04:58:58 +04:00
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c