linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
@ 2012-11-20  9:29 Zheng Liu
  2012-11-20  9:29 ` [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate Zheng Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20  9:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel; +Cc: yan, Zheng Liu

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(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate
  2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
@ 2012-11-20  9:29 ` Zheng Liu
  2012-11-20  9:29 ` [PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate Zheng Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20  9:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel; +Cc: yan, Zheng Liu

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate
  2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
  2012-11-20  9:29 ` [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate Zheng Liu
@ 2012-11-20  9:29 ` Zheng Liu
  2012-11-20  9:29 ` [PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate Zheng Liu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20  9:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel; +Cc: yan, Zheng Liu

From: Zheng Liu <wenqing.lz@taobao.com>

Remove a sanity check from xfs_file_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/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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate
  2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
  2012-11-20  9:29 ` [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate Zheng Liu
  2012-11-20  9:29 ` [PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate Zheng Liu
@ 2012-11-20  9:29 ` Zheng Liu
  2012-11-20  9:29 ` [PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate Zheng Liu
  2012-11-20 10:14 ` [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Christoph Hellwig
  4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20  9:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel; +Cc: yan, Zheng Liu

From: Zheng Liu <wenqing.lz@taobao.com>

Remove a sanity check from btrfs_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/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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate
  2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
                   ` (2 preceding siblings ...)
  2012-11-20  9:29 ` [PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate Zheng Liu
@ 2012-11-20  9:29 ` Zheng Liu
  2012-11-20 10:14 ` [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Christoph Hellwig
  4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20  9:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel; +Cc: yan, Zheng Liu

From: Zheng Liu <wenqing.lz@taobao.com>

Remove a sanity check from ocfs2_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/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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
  2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
                   ` (3 preceding siblings ...)
  2012-11-20  9:29 ` [PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate Zheng Liu
@ 2012-11-20 10:14 ` Christoph Hellwig
  2012-11-20 10:46   ` Zheng Liu
  4 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2012-11-20 10:14 UTC (permalink / raw)
  To: Zheng Liu
  Cc: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel, yan,
	Zheng Liu

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
  2012-11-20 10:14 ` [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Christoph Hellwig
@ 2012-11-20 10:46   ` Zheng Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2012-11-20 10:46 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-fsdevel, linux-ext4, xfs, linux-btrfs, ocfs2-devel, yan,
	Zheng Liu

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-20 10:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20  9:29 [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Zheng Liu
2012-11-20  9:29 ` [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate Zheng Liu
2012-11-20  9:29 ` [PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate Zheng Liu
2012-11-20  9:29 ` [PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate Zheng Liu
2012-11-20  9:29 ` [PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate Zheng Liu
2012-11-20 10:14 ` [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2 Christoph Hellwig
2012-11-20 10:46   ` Zheng Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).