Btrfs: add fiemap's flag check
diff mbox

Message ID
State New, archived
Headers show

Commit Message

Tsutomu Itoh Nov. 29, 2012, 5:08 a.m. UTC
When the flag not supported is specified, it is necessary to return the error
to the caller.
So, we add the validity check of the fiemap's flag.

Signed-off-by: Tsutomu Itoh <>
 fs/btrfs/inode.c | 8 ++++++++
 1 file changed, 8 insertions(+)

To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to
More majordomo info at

diff mbox

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5fc0990..1e09991 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6582,9 +6582,17 @@  static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
 		   btrfs_submit_direct, 0);
 static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 		__u64 start, __u64 len)
+	int	ret;
+	ret = fiemap_check_flags(fieinfo, BTRFS_FIEMAP_FLAGS);
+	if (ret)
+		return ret;
 	return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent_fiemap);