All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Thomas Liu <tliu@redhat.com>, selinux@tycho.nsa.gov
Subject: Re: [PATCH] setfiles converted to fts
Date: Tue, 30 Jun 2009 16:57:13 -0400	[thread overview]
Message-ID: <4A4A7C29.5060807@redhat.com> (raw)
In-Reply-To: <1246391251.13464.126.camel@moss-pluto.epoch.ncsc.mil>

On 06/30/2009 03:47 PM, Stephen Smalley wrote:
> On Tue, 2009-06-30 at 15:32 -0400, Thomas Liu wrote:
>> This patch converted setfiles/restorecon to using fts instead of nftw.
>> It also removed forking, pipes and pre_stat because Dan Walsh and I
>> could not figure out what it was for.
>
> See:
> http://marc.info/?l=selinux&m=113627973615236&w=2
> for the rationale for that logic.
But this does not seem to be much benefit since fts files come with the 
stat already filled out.  Thomas removed all stat/lstat calls since you 
are not allowed to use the -D_FILE_OFFSET_BITS=64 with fts.
>
> Did you run any measurements to assess the impact of your changes on setfiles?
>
I think the biggest impact on speed comes from not trying to read past a 
failed directory.

One thing that would be helpful to add would be to check if a directory 
is on a files system that supports labeling, if not then the directory 
should be skipped.  I think with this patch the tool would walk a nfs_t 
file system unless it is called as setfiles.
> Did you compare with the implementation of setfsmac.c in FreeBSD, which
> likewise started life as setfiles and was then rewritten to use fts()?
>
> What improvements do we get from the changes?
>
> Should we be using fts_path or fts_accpath when performing operations on
> the files, like lsetfilecon()?  I suspect the latter would be more
> efficient and less prone to simultaneous changes to the file tree if fts
> switches the cwd as it walks the tree.
>
> IIRC, we called lstat() within apply_spec() even though a struct stat
> was supplied as an argument because in the case of symlinks, we were
> getting the stat of the referenced file rather than of the symlink file.
> Is this true of fts?
>


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2009-06-30 20:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 19:32 [PATCH] setfiles converted to fts Thomas Liu
2009-06-30 19:47 ` Stephen Smalley
2009-06-30 20:57   ` Daniel J Walsh [this message]
2009-07-01 13:41     ` Stephen Smalley
2009-07-01 13:52       ` Stephen Smalley
2009-07-01 14:31 ` Stephen Smalley
2009-07-01 14:41   ` Thomas Liu

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=4A4A7C29.5060807@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=tliu@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 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.