Skip to contentSkip to conversation

btrfs: issues with SUBVOL_SETFLAGS

DISCUSSION Dan Rosenberg 2 participants 2 messages Feb 9, 2011 – Feb 10, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Commit 0caa102da82799efaba88e234484786a9591c797 introduced the SUBVOL_SETFLAGS ioctl, which contains the following check:

	if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC)
		return -EINVAL;

	if (flags & ~BTRFS_SUBVOL_RDONLY)
		return -EOPNOTSUPP;

Is it intentional that 0 is the only acceptable flags value? In addition, there should probably be an inode ownership check before allowing setting subvolume flags.

Regards,
Dan

#1 lore raw
Quoted 4 lines · Dan Rosenberg

Commit 0caa102da82799efaba88e234484786a9591c797 introduced the SUBVOL_SETFLAGS ioctl, which contains the following check:

if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC)

Oops, should be:

if (flags & BTRFS_SUBVOL_CREATE_ASYNC)

Quoted 9 lines
		return -EINVAL;

	if (flags & ~BTRFS_SUBVOL_RDONLY)
		return -EOPNOTSUPP;

Is it intentional that 0 is the only acceptable flags value? In addition, there should probably be an inode ownership check before allowing setting subvolume flags.

Thanks for pointing it out! Fix will be sent out soon.