]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: allocate root item at snapshot ioctl time
authorDavid Sterba <dsterba@suse.com>
Tue, 10 Nov 2015 17:54:00 +0000 (18:54 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jan 2016 14:20:54 +0000 (15:20 +0100)
commit4227564d44e13748395c3f9afa9c24eb470e6013
treebf2aa288dd2d98143b12ea1753739491c7eda54d
parent7bbda428125fc604dc19087b78197dc6606dcad4
btrfs: allocate root item at snapshot ioctl time

The actual snapshot creation is delayed until transaction commit. If we
cannot get enough memory for the root item there, we have to fail the
whole transaction commit which is bad. So we'll allocate the memory at
the ioctl call and pass it along with the pending_snapshot struct. The
potential ENOMEM will be returned to the caller of snapshot ioctl.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h