From: =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: [PATCH] ext4: fallocate_zero_range, check if is regular file Date: Thu, 17 Apr 2014 13:08:49 +0200 (CEST) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "linux-ext4@vger.kernel.org List" To: jon ernst Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750986AbaDQLIx (ORCPT ); Thu, 17 Apr 2014 07:08:53 -0400 In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org List-ID: On Thu, 17 Apr 2014, jon ernst wrote: > Date: Thu, 17 Apr 2014 00:22:04 -0400 > From: jon ernst > To: "linux-ext4@vger.kernel.org List" > Subject: [PATCH] ext4: fallocate_zero_range, check if is regular file > > fallocate_zero_range, check if inode is regular file. > > Signed-off-by: Jon Ernst Thanks, you can add. Reviewed-by: Lukas Czerner > --- > fs/ext4/extents.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c > index 1bb3e4b..756a3b9 100644 > --- a/fs/ext4/extents.c > +++ b/fs/ext4/extents.c > @@ -4742,6 +4742,8 @@ static long ext4_zero_range(struct file *file, > loff_t offset, > > trace_ext4_zero_range(inode, offset, len, mode); > > + if (!S_ISREG(inode->i_mode)) > + return -EOPNOTSUPP; > /* > * Write out all dirty pages to avoid race conditions > * Then release them.