9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Alexander Viro <viro@math.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] 9fs/9auth for FreeBSD
Date: Wed, 28 Mar 2001 14:35:00 -0500	[thread overview]
Message-ID: <Pine.GSO.4.21.0103281428320.26500-100000@weyl.math.psu.edu> (raw)
In-Reply-To: <200103281926.f2SJQnl94482@orthanc.ab.ca>



On Wed, 28 Mar 2001, Lyndon Nerenberg wrote:

>     Russ> the biggest shortcoming
>     Russ> is the lack of a portable way to implement append-only
>     Russ> files.  freebsd (and presumably the other unix clones) take
>     Russ> append-only to mean "only appends succeed" rather than "all
>     Russ> writes are treated as appends", and there's no standard way
>     Russ> to enable even this.
 
> On 4.4BSD-derived systems you should be able to get the behaviour you
> want with chflags(path, UF_APPEND) after creating the file.  During
> subsequent opens you would have to check for this flag, and open with
> O_APPEND if it is present (to force the writes to always be treated as
> appends). Did you try this? (I realize it's not very portable.)
 
> Without chflags() you would have to hijack on of the mode bits, which
> is downright evil.

In case of Linux append-only is "all writes are treated as appends"
(see mm/filemap.c::generic_file_write()), so no wanking with O_APPEND
on subsequent open() is needed, but marking file append-only
_is_ downright evil - ioctl(fd, EXT2_IOC_SETFLAGS, EXT2_APPEND_FL).
chflags() had been discussed many times, there are several patches
of varying age that implement it, but nobody cared enough to get
them into the tree.



  reply	other threads:[~2001-03-28 19:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-28  3:46 Russ Cox
2001-03-28 19:26 ` Lyndon Nerenberg
2001-03-28 19:35   ` Alexander Viro [this message]
2001-03-28 19:48     ` Lyndon Nerenberg
2001-03-29  8:27   ` Boyd Roberts
  -- strict thread matches above, loose matches on Subject: below --
2001-04-02  9:28 Russ Cox
2001-03-28 21:50 Russ Cox
2001-03-28 21:58 ` Lyndon Nerenberg
2001-03-28 22:23   ` Alexander Viro
2001-03-28 22:28     ` Alexander Viro
2001-03-28 22:56       ` Lyndon Nerenberg
2001-03-28 23:30         ` Lyndon Nerenberg
2001-03-28 23:35         ` Alexander Viro
2001-03-28 23:44           ` Lyndon Nerenberg
2001-03-29  0:20             ` Alexander Viro
2001-04-02  8:48       ` Douglas A. Gwyn
2001-04-02 10:04         ` Alexander Viro
2001-04-02 12:58           ` Boyd Roberts
2001-03-28 22:22 ` Alexander Viro
2001-04-02  8:49   ` Douglas A. Gwyn
2001-04-02 10:23     ` Alexander Viro
2001-03-27 23:53 Lyndon Nerenberg
2001-03-28  0:32 ` Christopher Nielsen
2001-03-28 19:32   ` Lyndon Nerenberg

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=Pine.GSO.4.21.0103281428320.26500-100000@weyl.math.psu.edu \
    --to=viro@math.psu.edu \
    --cc=9fans@cse.psu.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;
as well as URLs for NNTP newsgroup(s).