Skip to contentSkip to conversation

ext4: fix flags validity checking for EXT4_IOC_CHECKPOINT

PATCH In review Theodore Ts'o 2 participants 2 messages Jul 2, 2021 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: fix flags validity checking for EXT4_IOC_CHECKPOINT

Use the correct bitmask when checking for any not-yet-supported flags.

Fixes 351a0a3fbc35 ("ext4: add ioctl EXT4_IOC_CHECKPOINT")
Cc Leah Rumancik <[email protected]>
---
 fs/ext4/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/ioctl.c +1 -1
index 5730aeca563c..6eed6170aded 100644
@@ -823,7 +823,7 @@ static int ext4_ioctl_checkpoint(struct file *filp, unsigned long arg)
 	if (!EXT4_SB(sb)->s_journal)
 		return -ENODEV;
 
-	if (flags & ~JBD2_JOURNAL_FLUSH_VALID)
+	if (flags & ~EXT4_IOC_CHECKPOINT_FLAG_VALID)
 		return -EINVAL;
 
 	q = bdev_get_queue(EXT4_SB(sb)->s_journal->j_dev);
Signature · 1 line
2.31.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Theodore Ts'o

Use the correct bitmask when checking for any not-yet-supported flags.

Fixes 351a0a3fbc35 ("ext4: add ioctl EXT4_IOC_CHECKPOINT")
Cc Leah Rumancik <[email protected]>
---
 fs/ext4/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/ioctl.c +1 -1
index 5730aeca563c..6eed6170aded 100644
@@ -823,7 +823,7 @@ static int ext4_ioctl_checkpoint(struct file *filp, unsigned long arg)
 	if (!EXT4_SB(sb)->s_journal)
 		return -ENODEV;
 
-	if (flags & ~JBD2_JOURNAL_FLUSH_VALID)
+	if (flags & ~EXT4_IOC_CHECKPOINT_FLAG_VALID)
 		return -EINVAL;
 
 	q = bdev_get_queue(EXT4_SB(sb)->s_journal->j_dev);
Signature · 1 line
2.31.0

Thanks for the fix.

-Leah