diff mbox

[1/4,RFC] ext4: remove duplicated check from ext4_fallocate

Message ID 1353403785-3489-2-git-send-email-wenqing.lz@taobao.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Zheng Liu Nov. 20, 2012, 9:29 a.m. UTC
From: Zheng Liu <wenqing.lz@taobao.com>

Remove a sanity check from ext4_fallocate because vfs has already checked it.

Reported-by: Guo Chao <yan@linux.vnet.ibm.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/extents.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Nehemiah Dacres Nov. 20, 2012, 4:11 p.m. UTC | #1
I wanted to know if any one else is writing a  BTRFS gui other than
the writers of  BTRFS-GUI (http://carfax.org.uk/btrfs-gui) who haven't
updated svn sense 2009  I think. Is there any documentation on
communicating with /dev/btrfs-controle ? a command list? I've looked
at the source of btrfs.c but I don't want to depend on my
understanding of it.

On Tue, Nov 20, 2012 at 3:29 AM, Zheng Liu <gnehzuil.liu@gmail.com> wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> Remove a sanity check from ext4_fallocate because vfs has already checked it.
>
> Reported-by: Guo Chao <yan@linux.vnet.ibm.com>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
>  fs/ext4/extents.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 7011ac9..c2eb409 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4427,10 +4427,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
>         if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
>                 return -EOPNOTSUPP;
>
> -       /* Return error if mode is not supported */
> -       if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
> -               return -EOPNOTSUPP;
> -
>         if (mode & FALLOC_FL_PUNCH_HOLE)
>                 return ext4_punch_hole(file, offset, len);
>
> --
> 1.7.12.rc2.18.g61b472e
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 7011ac9..c2eb409 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4427,10 +4427,6 @@  long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 	if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
 		return -EOPNOTSUPP;
 
-	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
-		return -EOPNOTSUPP;
-
 	if (mode & FALLOC_FL_PUNCH_HOLE)
 		return ext4_punch_hole(file, offset, len);