]> 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)
commitea6c36e496b64d510bdcb7db5f631c605bd6c894
treebf2aa288dd2d98143b12ea1753739491c7eda54d
parentbf0b401014448735546728fb08e7e4688132a2f1
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