]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: adjust outstanding_extents counter properly when dio write is split
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 23 Dec 2016 01:13:54 +0000 (17:13 -0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Jan 2017 16:29:50 +0000 (17:29 +0100)
commit13d4213367c388af83d00bb7efc8a1511b2dd020
treee427359939b7ae3c7ef9eda9839ca3ccd0739b98
parenteed8b908b1aab0d90bce06d9a5754f9a5a7569e4
Btrfs: adjust outstanding_extents counter properly when dio write is split

Currently how btrfs dio deals with split dio write is not good
enough if dio write is split into several segments due to the
lack of contiguous space, a large dio write like 'dd bs=1G count=1'
can end up with incorrect outstanding_extents counter and endio
would complain loudly with an assertion.

This fixes the problem by compensating the outstanding_extents
counter in inode if a large dio write gets split.

Reported-by: Anand Jain <anand.jain@oracle.com>
Tested-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c