Skip to content
Commit 8b8b08cb authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: fix delalloc accounting after copy_from_user faults

Commit 56244ef1

 was almost but not quite enough to fix the
reservation math after btrfs_copy_from_user returned partial copies.

Some users are still seeing warnings in btrfs_destroy_inode, and with a
long enough test run I'm able to trigger them as well.

This patch fixes the accounting math again, bringing it much closer to
the way it was before the sectorsize conversion Chandan did.  The
problem is accounting for the offset into the page/sector when we do a
partial copy.  This one just uses the dirty_sectors variable which
should already be updated properly.

Signed-off-by: default avatarChris Mason <clm@fb.com>
cc: stable@vger.kernel.org # v4.6+
parent bac357dc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment