coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "ls -l": Avoid unnecessary getxattr() overhead


From: Pádraig Brady
Subject: Re: "ls -l": Avoid unnecessary getxattr() overhead
Date: Mon, 20 Feb 2012 12:45:48 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 02/19/2012 05:00 PM, Jim Meyering wrote:
> Pádraig Brady wrote:
>> Also I was a bit surprised to see EBUSY and ENOENT in errno_unsupported().
>> Can one assume there are no other attributes on a device if you get those?
> 
> I added those to align with ACL_NOT_WELL_SUPPORTED from
> lib/acl-internal.h, but now that you mention it, I suppose we'll need
> different errno-checking functions for ACL-related than for getfilecon
> failures.  I suppose ENOENT can arise when the file is removed between
> when we stat'd it and when we perform one of these three file-name-using
> tests.

OK to push this so?

commit 7f48aa570d93347aa72d86a034e36377db6a22b9
Author: Pádraig Brady <address@hidden>
Date:   Mon Feb 20 12:33:17 2012 +0000

    ls: adjust errnos indicating device non support for xattrs

    * src/ls.c (errno_unsupported): Remove EBUSY, as this caters for
    the case where ACLs can't be accessed because the _file_ is locked.
    http://lists.gnu.org/archive/html/bug-coreutils/2005-06/msg00191.html
    Also ENOENT is not safe to include as you get that if the _file_
    is removed between the stat() and subsequent querying of xattrs.

diff --git a/src/ls.c b/src/ls.c
index 92b17a4..f1dfb1e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2783,9 +2783,7 @@ clear_files (void)
 static bool
 errno_unsupported (int err)
 {
-  return (err == EBUSY
-          || err == EINVAL
-          || err == ENOENT
+  return (err == EINVAL
           || err == ENOSYS
           || err == ENOTSUP
           || err == EOPNOTSUPP);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]