Skip to content

Commit ad01dad

Browse files
Christoph Hellwigbrauner
authored andcommitted
block: remove checks for FALLOC_FL_NO_HIDE_STALE
While the FALLOC_FL_NO_HIDE_STALE value has been registered, it has always been rejected by vfs_fallocate before making it into blkdev_fallocate because it isn't in the supported mask. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240827065123.1762168-2-hch@lst.de Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 47ac09b commit ad01dad

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

block/fops.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
771771

772772
#define BLKDEV_FALLOC_FL_SUPPORTED \
773773
(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE | \
774-
FALLOC_FL_ZERO_RANGE | FALLOC_FL_NO_HIDE_STALE)
774+
FALLOC_FL_ZERO_RANGE)
775775

776776
static long blkdev_fallocate(struct file *file, int mode, loff_t start,
777777
loff_t len)
@@ -830,14 +830,6 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
830830
len >> SECTOR_SHIFT, GFP_KERNEL,
831831
BLKDEV_ZERO_NOFALLBACK);
832832
break;
833-
case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE | FALLOC_FL_NO_HIDE_STALE:
834-
error = truncate_bdev_range(bdev, file_to_blk_mode(file), start, end);
835-
if (error)
836-
goto fail;
837-
838-
error = blkdev_issue_discard(bdev, start >> SECTOR_SHIFT,
839-
len >> SECTOR_SHIFT, GFP_KERNEL);
840-
break;
841833
default:
842834
error = -EOPNOTSUPP;
843835
}

0 commit comments

Comments
 (0)