public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <namjae.jeon@samsung.com>
To: 'Zheng Liu' <gnehzuil.liu@gmail.com>
Cc: "'Theodore Ts'o'" <tytso@mit.edu>,
	'linux-ext4' <linux-ext4@vger.kernel.org>,
	"'Lukáš Czerner'" <lczerner@redhat.com>
Subject: RE: [PATCH] ext4: use EINVAL if not a regular file in ext4_fallocate()
Date: Wed, 23 Apr 2014 17:35:35 +0900	[thread overview]
Message-ID: <004b01cf5ece$ff6fe1b0$fe4fa510$@samsung.com> (raw)
In-Reply-To: <20140423060823.GA9262@gmail.com>

> On Sat, Apr 19, 2014 at 02:11:07PM +0900, Namjae Jeon wrote:
> > From: Namjae Jeon <namjae.jeon@samsung.com>
> >
> > Punch hole return EOPNOTSUPP about a non-REGULAR file also. So change EINVAL
> > to be consistent with xfs. And move this check to the start of
> > ext4_fallocate().
> 
> IMHO, EOPNOTSUPP makes sense to me.  From the man page of fallocate(2):
Hi Zheng.
IMHO, EOPNOTSUPP should be used where the operation is not yet implemented but
there is some chance that it could be implemented in future.
for example, it is ok for FS which has not yet implemented punch hole to
return EOPNOTSUPP as they could implement it in future. but for the cases where
it does not make sense to implement the operation, for example punching hole
for non regular files does not make any sense, it is better to use EINVAL.
On these lines, I agree that returning EOPNOTSUPP for collapse range in case of
non-extent based file is ok, as it is plausible to implemet collapse range for
non extent files in future.

Thanks for your opinion!
> 
> EOPNOTSUPP
>       The filesystem containing the file referred to by fd does not
>       support this operation; or the mode is not supported by the
>       filesystem containing the file referred to by fd.
> 
> Regards,
>                                                 - Zheng



  parent reply	other threads:[~2014-04-23  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19  5:11 [PATCH] ext4: use EINVAL if not a regular file in ext4_fallocate() Namjae Jeon
2014-04-23  6:08 ` Zheng Liu
2014-04-23  6:36   ` Namjae Jeon
2014-04-23  8:35   ` Namjae Jeon [this message]
2014-04-23 13:23   ` Lukáš Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004b01cf5ece$ff6fe1b0$fe4fa510$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=gnehzuil.liu@gmail.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox