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>
This commit is contained in:
@@ -137,6 +137,7 @@ struct btrfs_pending_snapshot {
|
||||
struct dentry *dentry;
|
||||
struct inode *dir;
|
||||
struct btrfs_root *root;
|
||||
struct btrfs_root_item *root_item;
|
||||
struct btrfs_root *snap;
|
||||
struct btrfs_qgroup_inherit *inherit;
|
||||
/* block reservation for the operation */
|
||||
|
Reference in New Issue
Block a user