]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix delalloc accounting after copy_from_user faults
authorChris Mason <clm@fb.com>
Tue, 19 Jul 2016 12:52:36 +0000 (05:52 -0700)
committerChris Mason <clm@fb.com>
Thu, 21 Jul 2016 11:03:40 +0000 (04:03 -0700)
commite8988fd2c69da8e727e3e1de7ed7b90e2e499028
tree1b53d06941d504cef36b4e85ac874717d78e21c3
parenta0d55aac61bb6d3de7be1ac7025653a02b631785
Btrfs: fix delalloc accounting after copy_from_user faults

Commit 7b3a7fefb6c638fc 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: Chris Mason <clm@fb.com>
cc: stable@vger.kernel.org # v4.6+
fs/btrfs/file.c