linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH e2fsprogs] return status from chattr
Date: Mon, 22 Oct 2007 01:27:47 -0400	[thread overview]
Message-ID: <20071022052747.GA29220@thunk.org> (raw)
In-Reply-To: <46F2B47A.1070902@redhat.com>

On Thu, Sep 20, 2007 at 12:57:14PM -0500, Eric Sandeen wrote:
> I changed this a bit so that if it's explicitly listed on the
> commandline, the link itself gets chattr'd.  I'm not quite sure 
> what is intended here; that the links are not *followed* or
> that they are not chattr'd?  Seems a little odd to me.

Both; you can't chattr a symlink.  You can try, but in fact what
happens is that you end up chattr'ing the destination of the link,
which is probably not what you want.

> I tried to follow the way other recursive commands work, for example
> chmod -R, and carry on in the face of any errors.  If any error
> was encountered, exit with an error.  If no errors, exit 0.

Yep, that makes sense.

> Also, if both flags and -v (version) are specified, and the flag 
> set encounters an error, the version set is not attempted.  Is this 
> ok or should both commands be tried?

I think an atomic failure makes the most amount of sense.

> Finally, I'm curious, the utility ignores anything that's not a link,
> regular file, or dir, but the kernel code doesn't have these checks.
> Should it?

For better or for worse, the ext2/3/4 flags are set via an ioctl.
This means it doesn't work for anything other than a regular file or a
directory.  For a symlink, it will fail, or follow the symlink.
There's a bug in libe2p which I'll fix which causes it to not return
EOPNOTSUPP for symlinks because it's using stat() when it should use
lstat().

So we should be ignoring symbolic links, as well, since we can't
change them.

						- Ted

      parent reply	other threads:[~2007-10-22  5:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20 17:57 [PATCH e2fsprogs] return status from chattr Eric Sandeen
2007-10-19 18:55 ` Eric Sandeen
2007-10-22 12:55   ` Theodore Tso
2007-10-22 13:30     ` [PATCH] libe2p: Use lstat() instead of stat() in fsetflags() and fgetflags() Theodore Ts'o
2007-10-22 13:30       ` [PATCH] libe2p: Change iterate_on_dir so that it counts non-zero returns Theodore Ts'o
2007-10-22 13:30         ` [PATCH] chattr: provide an exit code in case of failure and add -f flag Theodore Ts'o
2007-10-22  5:27 ` Theodore Tso [this message]

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=20071022052747.GA29220@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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).