From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rohan Puri Subject: Re: [PATCH 2/2] Remove redundant inode mode checks for ceph & ext4 Date: Fri, 18 Jul 2014 16:16:26 +0530 Message-ID: References: <5392d55b272f9a5bd64961cc296ea79c1f41f556.1405676678.git.rohan.puri15@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: hch@infradead.org, viro@zeniv.linux.org.uk, Linux FS Devel To: =?UTF-8?B?THVrw6HFoSBDemVybmVy?= Return-path: Received: from mail-la0-f53.google.com ([209.85.215.53]:45732 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761234AbaGRKq2 convert rfc822-to-8bit (ORCPT ); Fri, 18 Jul 2014 06:46:28 -0400 Received: by mail-la0-f53.google.com with SMTP id gl10so2663723lab.40 for ; Fri, 18 Jul 2014 03:46:26 -0700 (PDT) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jul 18, 2014 at 4:02 PM, Luk=C3=A1=C5=A1 Czerner wrote: > On Fri, 18 Jul 2014, Rohan Puri wrote: > >> Date: Fri, 18 Jul 2014 15:28:38 +0530 >> From: Rohan Puri >> To: hch@infradead.org, viro@zeniv.linux.org.uk >> Cc: linux-fsdevel@vger.kernel.org >> Subject: [PATCH 2/2] Remove redundant inode mode checks for ceph & e= xt4 >> >> These checks are not needed here, since they are already performed >> by do_fallocate() > > NAK, they are actually needed because we do not support fallocate on > directories here. > But we never get to file systems for fallocate in directory case, we either return from open() itself or do_fallocate() before calling f_ops->fallocate() > -Lukas > >> >> Signed-off-by: Rohan Puri >> --- >> fs/ceph/file.c | 3 --- >> fs/ext4/inode.c | 3 --- >> 2 files changed, 6 deletions(-) >> >> diff --git a/fs/ceph/file.c b/fs/ceph/file.c >> index 88a6df4..687a72e 100644 >> --- a/fs/ceph/file.c >> +++ b/fs/ceph/file.c >> @@ -1218,9 +1218,6 @@ static long ceph_fallocate(struct file *file, = int mode, >> loff_t endoff =3D 0; >> loff_t size; >> >> - if (!S_ISREG(inode->i_mode)) >> - return -EOPNOTSUPP; >> - >> mutex_lock(&inode->i_mutex); >> >> if (ceph_snap(inode) !=3D CEPH_NOSNAP) { >> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c >> index 7fcd68e..22c9868 100644 >> --- a/fs/ext4/inode.c >> +++ b/fs/ext4/inode.c >> @@ -3532,9 +3532,6 @@ int ext4_punch_hole(struct inode *inode, loff_= t offset, loff_t length) >> unsigned int credits; >> int ret =3D 0; >> >> - if (!S_ISREG(inode->i_mode)) >> - return -EOPNOTSUPP; >> - >> trace_ext4_punch_hole(inode, offset, length, 0); >> >> /* >> -- 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