Zheng Liu
2012-Nov-20 09:29 UTC
[PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Zheng Liu
2012-Nov-20 09:29 UTC
[PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate
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
Zheng Liu
2012-Nov-20 09:29 UTC
[PATCH 2/4][RFC] xfs: remove duplicated check from xfs_file_fallocate
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 -- 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
Zheng Liu
2012-Nov-20 09:29 UTC
[PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate
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 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Zheng Liu
2012-Nov-20 09:29 UTC
[PATCH 4/4][RFC] ocfs2: remove duplicated check from ocfs2_fallocate
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 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Christoph Hellwig
2012-Nov-20 10:14 UTC
[Ocfs2-devel] [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
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.
Zheng Liu
2012-Nov-20 10:46 UTC
Re: [PATCH 0/4][RFC] remove duplicated check from ext4, xfs, btrfs, and ocfs2
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 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Nehemiah Dacres
2012-Nov-20 16:11 UTC
Re: [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate
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