All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Russell Coker <russell@coker.com.au>
Cc: Stephen Smalley <sds@epoch.ncsc.mil>, reiserfs-list@namesys.com
Subject: Re: xattr
Date: 19 Jun 2003 10:55:47 -0400	[thread overview]
Message-ID: <1056034546.5532.103.camel@tiny.suse.com> (raw)
In-Reply-To: <200306200046.52292.russell@coker.com.au>

On Thu, 2003-06-19 at 10:46, Russell Coker wrote:
> On the topic of atomic xattr operations on ReiserFS as needed for the new 
> LSM/SE Linux operations.
> 
> On Thu, 19 Jun 2003 23:52, Chris Mason wrote:
> > How big are the xattrs you have in mind?  We can get atomic writes of 4k
> > in length but beyond that things get more difficult.
> 
> Most of them will be less than 80 bytes.  They are currently of the form:
> user-name:object_r:type
> 
> The user-name is the Unix account name which usually isn't much more than 8 
> bytes.  The "type" is usually less than 15 bytes (the longest I've used so 
> far is 20 bytes).
> 
> So the longest value I've used is 38 bytes.
> 

Then data=journal mode will do what you want.  You'll get atomic writes
up to 4k.  If you really don't want data=journal for the rest of the FS,
we can make an option for using data logging on xattr files only.  Jeff
and I had wanted to avoid the complication but it is at least possible.

> Also they can't be chosen arbitarily by the user.  The user gets some small 
> control over the type within a range of types that the administrator permits.
> If the administrator permits overly long type names and has to deal with 
> non-atomicity as a result then it's their issue.
> 
> If you can guarantee atomic operations on 160 byte operations (twice what I 
> expect anyone to use) then it'll be fine.
> 
> > As for the xattr and the create in the same transaction, that's a little
> > harder.  We'd probably need a new syscall, or to change the semantics of
> > the xattr call such that creating an xattr on a file that doesn't exist
> > also creates the file.
> 
> Creating a file by creating the xattr sounds like a bad idea as you can't 
> control the Unix permissions of the file.  This isn't much of a big deal with 
> SE Linux as the security type determines who can access the file.  But for 
> other uses it may be a serious problem.
> 
> I agree that we need a new syscall and other people had the same idea before 
> either of us.
> 
> Maybe ReiserFS could be used as the first implementation of this proposed new 
> syscall...

It would be best to go through Andreas Gruenbacher for xattr API
changes.  He's quite reasonable.

-chris



  reply	other threads:[~2003-06-19 14:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-16 12:26 xattr Russell Coker
2003-06-17 11:04 ` xattr Hans Reiser
2003-06-19 13:52 ` xattr Chris Mason
2003-06-19 14:46   ` xattr Russell Coker
2003-06-19 14:55     ` Chris Mason [this message]
2003-06-19 15:12       ` xattr Russell Coker
2003-06-19 15:10     ` xattr Stephen Smalley
2003-06-19 15:21       ` xattr Chris Mason
2003-06-19 17:25         ` xattr Stephen Smalley
2003-06-19 18:06           ` xattr Chris Mason
2003-06-19 18:52             ` xattr Stephen Smalley
2003-06-19 18:55             ` how to fix the file system which has a dangling file? bmoon
2003-06-23  7:56   ` xattr Hans Reiser
     [not found] <200312021433.48383.russell@coker.com.au>
2003-12-02 14:45 ` xattr James Carter
2003-12-02 14:45 ` xattr James Carter

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=1056034546.5532.103.camel@tiny.suse.com \
    --to=mason@suse.com \
    --cc=reiserfs-list@namesys.com \
    --cc=russell@coker.com.au \
    --cc=sds@epoch.ncsc.mil \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.