public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Dmitry Mishin <dim@openvz.org>
Cc: Kirill Korotaev <dev@sw.ru>, Andrew Morton <akpm@osdl.org>,
	viro@zeniv.linux.org.uk,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] move IMMUTABLE|APPEND checks to notify_change()
Date: Wed, 9 Aug 2006 15:11:00 +0100	[thread overview]
Message-ID: <20060809141100.GP29920@ftp.linux.org.uk> (raw)
In-Reply-To: <200608091115.12949.dim@openvz.org>

On Wed, Aug 09, 2006 at 11:15:12AM +0400, Dmitry Mishin wrote:
> Do you meant utimes(file, NULL)?
> But is it correct behaviour? Why then do you get -EPERM on utimes(file, smth) 
> if the file is append-only? And why do you get -EACCESS on utimes(file, 
> NULL), if this file is immutable?
> 
> Could you explain, why is it done so?

RTFPOSIX...

Short version:
	* immutable files are immutable, including metadata
	* append-only files may be touched (when you write to the end), which
means that you can touch them.  Which is what utimes(file, NULL) does.
	* you can not truncate append-only file, overwrite already written
data or set timestamps to arbitrary values.

That's where the difference between utimes(file, NULL) and utimes(file, p)
is - the former basically is a write-without-write ("touch foo") and the
latter directly assigns to timestamps.  Permissions needed for these are
obviously different.

Please, read POSIX/SuS when modifying behaviour of syscalls.  Really.

  reply	other threads:[~2006-08-09 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08 11:44 [PATCH] move IMMUTABLE|APPEND checks to notify_change() Kirill Korotaev
2006-08-08 20:38 ` Al Viro
2006-08-09  7:15   ` Dmitry Mishin
2006-08-09 14:11     ` Al Viro [this message]
2006-08-09  9:07   ` Kirill Korotaev
2006-08-09 10:11   ` Kirill Korotaev

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=20060809141100.GP29920@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=dev@sw.ru \
    --cc=dim@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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