Quantcast

[PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2

Zheng Liu-2
Hi all,

This patch series tries to remove a sanity check in fallocate from specific
filesystems because vfs has already checked it.

I am not very familiar with why we need to do this duplicated check.  Please let
me know if I miss something.

Regards,
                                                - Zheng

---
Zheng Liu(4):
      ext4: remove dupoicated check from ext4_fallocate
      xfs: remove duplicated check from xfs_file_fallocate
      btrfs: remove duplicated check from btrfs_fallocate
      ocfs2: remove duplicated check from ocfs2_fallocate

 fs/btrfs/file.c   | 4 ----
 fs/ext4/extents.c | 4 ----
 fs/ocfs2/file.c   | 2 --
 fs/xfs/xfs_file.c | 3 ---
 4 files changed, 13 deletions(-)

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Zheng Liu-2
From: Zheng Liu <[hidden email]>

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

Reported-by: Guo Chao <[hidden email]>
Signed-off-by: Zheng Liu <[hidden email]>
---
 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

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate

Zheng Liu-2
In reply to this post by Zheng Liu-2
From: Zheng Liu <[hidden email]>

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

Reported-by: Guo Chao <[hidden email]>
Signed-off-by: Zheng Liu <[hidden email]>
---
 fs/ocfs2/file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 5a4ee77..2446efa 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2001,8 +2001,6 @@ static long ocfs2_fallocate(struct file *file, int mode, loff_t offset,
  int change_size = 1;
  int cmd = OCFS2_IOC_RESVSP64;
 
- if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
- return -EOPNOTSUPP;
  if (!ocfs2_writes_unwritten_extents(osb))
  return -EOPNOTSUPP;
 
--
1.7.12.rc2.18.g61b472e

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate

Zheng Liu-2
In reply to this post by Zheng Liu-2
From: Zheng Liu <[hidden email]>

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

Reported-by: Guo Chao <[hidden email]>
Signed-off-by: Zheng Liu <[hidden email]>
---
 fs/btrfs/file.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 9ab1bed..fd260a0 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1999,10 +1999,6 @@ static long btrfs_fallocate(struct file *file, int mode,
  alloc_start = offset & ~mask;
  alloc_end =  (offset + len + mask) & ~mask;
 
- /* Make sure we aren't being give some crap mode */
- if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
- return -EOPNOTSUPP;
-
  if (mode & FALLOC_FL_PUNCH_HOLE)
  return btrfs_punch_hole(inode, offset, len);
 
--
1.7.12.rc2.18.g61b472e

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate

Zheng Liu-2
In reply to this post by Zheng Liu-2
From: Zheng Liu <[hidden email]>

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

Reported-by: Guo Chao <[hidden email]>
Signed-off-by: Zheng Liu <[hidden email]>
---
 fs/xfs/xfs_file.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index aa473fa..7b50d12 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -815,9 +815,6 @@ xfs_file_fallocate(
  int cmd = XFS_IOC_RESVSP;
  int attr_flags = XFS_ATTR_NOLOCK;
 
- if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
- return -EOPNOTSUPP;
-
  bf.l_whence = 0;
  bf.l_start = offset;
  bf.l_len = len;
--
1.7.12.rc2.18.g61b472e

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2

Christoph Hellwig
In reply to this post by Zheng Liu-2
On Tue, Nov 20, 2012 at 05:29:41PM +0800, Zheng Liu wrote:
> Hi all,
>
> This patch series tries to remove a sanity check in fallocate from specific
> filesystems because vfs has already checked it.
>
> I am not very familiar with why we need to do this duplicated check.  Please let
> me know if I miss something.

Each filesystem driver checks to see if a flag that it doesn't support
gets passed down.  This was done with the intention that we can add new
flags to the VFS without having to update every filesystem.

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2

Zheng Liu-2
On Tue, Nov 20, 2012 at 05:14:53AM -0500, Christoph Hellwig wrote:

> On Tue, Nov 20, 2012 at 05:29:41PM +0800, Zheng Liu wrote:
> > Hi all,
> >
> > This patch series tries to remove a sanity check in fallocate from specific
> > filesystems because vfs has already checked it.
> >
> > I am not very familiar with why we need to do this duplicated check.  Please let
> > me know if I miss something.
>
> Each filesystem driver checks to see if a flag that it doesn't support
> gets passed down.  This was done with the intention that we can add new
> flags to the VFS without having to update every filesystem.

Thanks for your explanation.

Regards,
                                                - Zheng

_______________________________________________
xfs mailing list
[hidden email]
http://oss.sgi.com/mailman/listinfo/xfs
Loading...