summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-06-10 14:59:04 +0200
committerJosef Bacik <jbacik@fusionio.com>2013-07-01 14:52:28 +0200
commitd88d46c6e06cb47cd3b951287ccaf414e96560d0 (patch)
treed27bc2170fc83f70854ad4b887fb9eacfe863f26 /fs/btrfs/scrub.c
parentBtrfs: fix transaction throttling for delayed refs (diff)
downloadlinux-d88d46c6e06cb47cd3b951287ccaf414e96560d0.tar.xz
linux-d88d46c6e06cb47cd3b951287ccaf414e96560d0.zip
Btrfs: free csums when we're done scrubbing an extent
A user reported scrub taking up an unreasonable amount of ram as it ran. This is because we lookup the csums for the extent we're scrubbing but don't free it up until after we're done with the scrub, which means we can take up a whole lot of ram. This patch fixes this by dropping the csums once we're done with the extent we've scrubbed. The user reported this to fix their problem. Thanks, Reported-and-tested-by: Remco Hosman <remco@hosman.xs4all.nl> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 79bd479317cb..cb308a3a9300 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2505,6 +2505,7 @@ again:
if (ret)
goto out;
+ scrub_free_csums(sctx);
if (extent_logical + extent_len <
key.objectid + bytes) {
logical += increment;