https://github.com/torvalds/linux
Revision f7f43cc84152e53b5687cd0eb8823310ba065524 authored by Chris Mason on 11 October 2011, 15:41:40 UTC, committed by Chris Mason on 11 October 2011, 15:45:55 UTC
The btrfs file defrag code will loop through the extents and force COW on them. But there is a concurrent truncate in the middle of the defrag, it might end up defragging the same range over and over again. The problem is that writepage won't go through and do anything on pages past i_size, so the cow won't happen, so the file will appear to still be fragmented. defrag will end up hitting the same extents again and again. In the worst case, the truncate can actually live lock with the defrag because the defrag keeps creating new ordered extents which the truncate code keeps waiting on. The fix here is to make defrag check for i_size inside the main loop, instead of just once before the looping starts. Signed-off-by: Chris Mason <chris.mason@oracle.com>
1 parent 2a0f7f5
Tip revision: f7f43cc84152e53b5687cd0eb8823310ba065524 authored by Chris Mason on 11 October 2011, 15:41:40 UTC
Btrfs: make sure not to defrag extents past i_size
Btrfs: make sure not to defrag extents past i_size
Tip revision: f7f43cc
File | Mode | Size |
---|---|---|
debug | ||
events | ||
gcov | ||
irq | ||
power | ||
time | ||
trace | ||
.gitignore | -rw-r--r-- | 63 bytes |
Kconfig.freezer | -rw-r--r-- | 52 bytes |
Kconfig.hz | -rw-r--r-- | 1.7 KB |
Kconfig.locks | -rw-r--r-- | 4.5 KB |
Kconfig.preempt | -rw-r--r-- | 2.0 KB |
Makefile | -rw-r--r-- | 5.1 KB |
acct.c | -rw-r--r-- | 17.1 KB |
async.c | -rw-r--r-- | 9.0 KB |
audit.c | -rw-r--r-- | 39.4 KB |
audit.h | -rw-r--r-- | 5.7 KB |
audit_tree.c | -rw-r--r-- | 21.9 KB |
audit_watch.c | -rw-r--r-- | 14.2 KB |
auditfilter.c | -rw-r--r-- | 33.2 KB |
auditsc.c | -rw-r--r-- | 66.5 KB |
backtracetest.c | -rw-r--r-- | 2.1 KB |
bounds.c | -rw-r--r-- | 600 bytes |
capability.c | -rw-r--r-- | 10.7 KB |
cgroup.c | -rw-r--r-- | 137.3 KB |
cgroup_freezer.c | -rw-r--r-- | 9.4 KB |
compat.c | -rw-r--r-- | 28.4 KB |
configs.c | -rw-r--r-- | 2.8 KB |
cpu.c | -rw-r--r-- | 13.8 KB |
cpuset.c | -rw-r--r-- | 73.9 KB |
crash_dump.c | -rw-r--r-- | 1019 bytes |
cred.c | -rw-r--r-- | 21.9 KB |
delayacct.c | -rw-r--r-- | 4.9 KB |
dma.c | -rw-r--r-- | 3.6 KB |
elfcore.c | -rw-r--r-- | 459 bytes |
exec_domain.c | -rw-r--r-- | 4.3 KB |
exit.c | -rw-r--r-- | 46.7 KB |
extable.c | -rw-r--r-- | 3.7 KB |
fork.c | -rw-r--r-- | 42.0 KB |
freezer.c | -rw-r--r-- | 4.0 KB |
futex.c | -rw-r--r-- | 69.7 KB |
futex_compat.c | -rw-r--r-- | 4.9 KB |
groups.c | -rw-r--r-- | 6.0 KB |
hrtimer.c | -rw-r--r-- | 46.4 KB |
hung_task.c | -rw-r--r-- | 5.1 KB |
irq_work.c | -rw-r--r-- | 3.7 KB |
itimer.c | -rw-r--r-- | 7.3 KB |
jump_label.c | -rw-r--r-- | 9.0 KB |
kallsyms.c | -rw-r--r-- | 14.2 KB |
kexec.c | -rw-r--r-- | 38.8 KB |
kfifo.c | -rw-r--r-- | 12.7 KB |
kmod.c | -rw-r--r-- | 14.3 KB |
kprobes.c | -rw-r--r-- | 55.9 KB |
ksysfs.c | -rw-r--r-- | 5.1 KB |
kthread.c | -rw-r--r-- | 11.9 KB |
latencytop.c | -rw-r--r-- | 7.5 KB |
lockdep.c | -rw-r--r-- | 96.6 KB |
lockdep_internals.h | -rw-r--r-- | 4.5 KB |
lockdep_proc.c | -rw-r--r-- | 17.0 KB |
lockdep_states.h | -rw-r--r-- | 233 bytes |
module.c | -rw-r--r-- | 88.1 KB |
mutex-debug.c | -rw-r--r-- | 2.9 KB |
mutex-debug.h | -rw-r--r-- | 1.7 KB |
mutex.c | -rw-r--r-- | 13.3 KB |
mutex.h | -rw-r--r-- | 1.3 KB |
notifier.c | -rw-r--r-- | 16.9 KB |
nsproxy.c | -rw-r--r-- | 6.0 KB |
padata.c | -rw-r--r-- | 27.5 KB |
panic.c | -rw-r--r-- | 10.1 KB |
params.c | -rw-r--r-- | 21.3 KB |
pid.c | -rw-r--r-- | 13.8 KB |
pid_namespace.c | -rw-r--r-- | 4.5 KB |
pm_qos_params.c | -rw-r--r-- | 13.1 KB |
posix-cpu-timers.c | -rw-r--r-- | 42.4 KB |
posix-timers.c | -rw-r--r-- | 29.1 KB |
printk.c | -rw-r--r-- | 42.6 KB |
profile.c | -rw-r--r-- | 16.7 KB |
ptrace.c | -rw-r--r-- | 22.7 KB |
range.c | -rw-r--r-- | 2.9 KB |
rcupdate.c | -rw-r--r-- | 8.6 KB |
rcutiny.c | -rw-r--r-- | 8.4 KB |
rcutiny_plugin.h | -rw-r--r-- | 30.2 KB |
rcutorture.c | -rw-r--r-- | 46.3 KB |
rcutree.c | -rw-r--r-- | 61.8 KB |
rcutree.h | -rw-r--r-- | 18.5 KB |
rcutree_plugin.h | -rw-r--r-- | 57.9 KB |
rcutree_trace.c | -rw-r--r-- | 14.1 KB |
relay.c | -rw-r--r-- | 32.6 KB |
res_counter.c | -rw-r--r-- | 4.1 KB |
resource.c | -rw-r--r-- | 26.3 KB |
rtmutex-debug.c | -rw-r--r-- | 5.7 KB |
rtmutex-debug.h | -rw-r--r-- | 1.4 KB |
rtmutex-tester.c | -rw-r--r-- | 8.7 KB |
rtmutex.c | -rw-r--r-- | 26.3 KB |
rtmutex.h | -rw-r--r-- | 1.1 KB |
rtmutex_common.h | -rw-r--r-- | 3.3 KB |
rwsem.c | -rw-r--r-- | 2.6 KB |
sched.c | -rw-r--r-- | 222.2 KB |
sched_autogroup.c | -rw-r--r-- | 6.0 KB |
sched_autogroup.h | -rw-r--r-- | 947 bytes |
sched_clock.c | -rw-r--r-- | 8.0 KB |
sched_cpupri.c | -rw-r--r-- | 5.4 KB |
sched_cpupri.h | -rw-r--r-- | 931 bytes |
sched_debug.c | -rw-r--r-- | 11.8 KB |
sched_fair.c | -rw-r--r-- | 109.5 KB |
sched_features.h | -rw-r--r-- | 1.8 KB |
sched_idletask.c | -rw-r--r-- | 2.1 KB |
sched_rt.c | -rw-r--r-- | 42.2 KB |
sched_stats.h | -rw-r--r-- | 9.2 KB |
sched_stoptask.c | -rw-r--r-- | 2.1 KB |
seccomp.c | -rw-r--r-- | 1.6 KB |
semaphore.c | -rw-r--r-- | 7.2 KB |
signal.c | -rw-r--r-- | 79.2 KB |
smp.c | -rw-r--r-- | 18.4 KB |
softirq.c | -rw-r--r-- | 22.1 KB |
spinlock.c | -rw-r--r-- | 9.5 KB |
srcu.c | -rw-r--r-- | 10.4 KB |
stacktrace.c | -rw-r--r-- | 896 bytes |
stop_machine.c | -rw-r--r-- | 13.0 KB |
sys.c | -rw-r--r-- | 41.9 KB |
sys_ni.c | -rw-r--r-- | 5.7 KB |
sysctl.c | -rw-r--r-- | 69.0 KB |
sysctl_binary.c | -rw-r--r-- | 51.5 KB |
sysctl_check.c | -rw-r--r-- | 3.8 KB |
taskstats.c | -rw-r--r-- | 16.0 KB |
test_kprobes.c | -rw-r--r-- | 8.5 KB |
time.c | -rw-r--r-- | 18.7 KB |
timeconst.pl | -rw-r--r-- | 7.2 KB |
timer.c | -rw-r--r-- | 47.8 KB |
tracepoint.c | -rw-r--r-- | 16.3 KB |
tsacct.c | -rw-r--r-- | 4.2 KB |
uid16.c | -rw-r--r-- | 5.3 KB |
up.c | -rw-r--r-- | 413 bytes |
user-return-notifier.c | -rw-r--r-- | 1.3 KB |
user.c | -rw-r--r-- | 4.8 KB |
user_namespace.c | -rw-r--r-- | 3.4 KB |
utsname.c | -rw-r--r-- | 2.5 KB |
utsname_sysctl.c | -rw-r--r-- | 2.5 KB |
wait.c | -rw-r--r-- | 8.2 KB |
watchdog.c | -rw-r--r-- | 14.3 KB |
workqueue.c | -rw-r--r-- | 102.9 KB |
workqueue_sched.h | -rw-r--r-- | 311 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...