aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c2
-rw-r--r--fs/ext4/extents.c2
-rw-r--r--fs/gfs2/ops_inode.c2
-rw-r--r--fs/ocfs2/file.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c3
5 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a3798a3aa0d2..64daf2acd0d5 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7116,7 +7116,7 @@ static long btrfs_fallocate(struct inode *inode, int mode,
7116 alloc_end = (offset + len + mask) & ~mask; 7116 alloc_end = (offset + len + mask) & ~mask;
7117 7117
7118 /* We only support the FALLOC_FL_KEEP_SIZE mode */ 7118 /* We only support the FALLOC_FL_KEEP_SIZE mode */
7119 if (mode && (mode != FALLOC_FL_KEEP_SIZE)) 7119 if (mode & ~FALLOC_FL_KEEP_SIZE)
7120 return -EOPNOTSUPP; 7120 return -EOPNOTSUPP;
7121 7121
7122 /* 7122 /*
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c4068f6abf03..4bdd160854eb 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3645,7 +3645,7 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
3645 unsigned int credits, blkbits = inode->i_blkbits; 3645 unsigned int credits, blkbits = inode->i_blkbits;
3646 3646
3647 /* We only support the FALLOC_FL_KEEP_SIZE mode */ 3647 /* We only support the FALLOC_FL_KEEP_SIZE mode */
3648 if (mode && (mode != FALLOC_FL_KEEP_SIZE)) 3648 if (mode & ~FALLOC_FL_KEEP_SIZE)
3649 return -EOPNOTSUPP; 3649 return -EOPNOTSUPP;
3650 3650
3651 /* 3651 /*
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 040b5a2e6556..c09528c07f3d 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -1426,7 +1426,7 @@ static long gfs2_fallocate(struct inode *inode, int mode, loff_t offset,
1426 next = (next + 1) << sdp->sd_sb.sb_bsize_shift; 1426 next = (next + 1) << sdp->sd_sb.sb_bsize_shift;
1427 1427
1428 /* We only support the FALLOC_FL_KEEP_SIZE mode */ 1428 /* We only support the FALLOC_FL_KEEP_SIZE mode */
1429 if (mode && (mode != FALLOC_FL_KEEP_SIZE)) 1429 if (mode & ~FALLOC_FL_KEEP_SIZE)
1430 return -EOPNOTSUPP; 1430 return -EOPNOTSUPP;
1431 1431
1432 offset = (offset >> sdp->sd_sb.sb_bsize_shift) << 1432 offset = (offset >> sdp->sd_sb.sb_bsize_shift) <<
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 63e3fca266e0..cf254ce8c941 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1997,6 +1997,8 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
1997 int change_size = 1; 1997 int change_size = 1;
1998 int cmd = OCFS2_IOC_RESVSP64; 1998 int cmd = OCFS2_IOC_RESVSP64;
1999 1999
2000 if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
2001 return -EOPNOTSUPP;
2000 if (!ocfs2_writes_unwritten_extents(osb)) 2002 if (!ocfs2_writes_unwritten_extents(osb))
2001 return -EOPNOTSUPP; 2003 return -EOPNOTSUPP;
2002 2004
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index da54403633b6..a4ecc2188a09 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -518,6 +518,9 @@ xfs_vn_fallocate(
518 xfs_inode_t *ip = XFS_I(inode); 518 xfs_inode_t *ip = XFS_I(inode);
519 int cmd = XFS_IOC_RESVSP; 519 int cmd = XFS_IOC_RESVSP;
520 520
521 if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
522 return -EOPNOTSUPP;
523
521 /* preallocation on directories not yet supported */ 524 /* preallocation on directories not yet supported */
522 error = -ENODEV; 525 error = -ENODEV;
523 if (S_ISDIR(inode->i_mode)) 526 if (S_ISDIR(inode->i_mode))