Skip to content

Commit 7aebaab

Browse files
author
Kent Overstreet
committed
bcachefs: Fix creating snapshot with implict source
When creating a snapshot without specifying the source subvolume, we use the subvolume containing the new snapshot. Previously, this worked if the directory containing the new snapshot was the subvolume root - but we were using the incorrect helper, and got a subvolume ID of 0 when the parent directory wasn't the root of the subvolume, causing an emergency read-only. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent f88d811 commit 7aebaab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/bcachefs/fs-ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static long __bch2_ioctl_subvolume_create(struct bch_fs *c, struct file *filp,
413413

414414
if ((arg.flags & BCH_SUBVOL_SNAPSHOT_CREATE) &&
415415
!arg.src_ptr)
416-
snapshot_src.subvol = to_bch_ei(dir)->ei_inode.bi_subvol;
416+
snapshot_src.subvol = inode_inum(to_bch_ei(dir)).subvol;
417417

418418
inode = __bch2_create(file_mnt_idmap(filp), to_bch_ei(dir),
419419
dst_dentry, arg.mode|S_IFDIR,

0 commit comments

Comments
 (0)