bugGNU Core Utilities - Bugs: bug #25538, excluded files are still stat()ed

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #25538: excluded files are still stat()ed

Submitted by:  Kevin Pulo <devkev>
Submitted on:  Tue 10 Feb 2009 04:24:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Tue 10 Feb 2009 04:24:35 AM UTC, original submission:

My problem is that files I have excluded from du using -X or --exclude still have stat() run on them. In particular, this is a problem when trying to exclude some fuse filesystems on Linux, eg. sshfs and encfs, which deny all access to other users (including root).

For example:

The non-zero exit status is particularly troubling, since it means I cannot chain other commands after du using '&&' whenever it's operating on a tree that has these sorts of fuse fs's in it.

The only workaround at the moment is to exclude the parent directory, eg. --exclude=~kev/mnt/sf in the example above. This unfortunately means that everything else in that directory is also excluded.

Having looked at the code, I'm not sure how this would best be fixed. The list of excluded files is only used in process_file(), which is too late. I presume that the stat() is happening inside fts_read(), which populates end->fts_statp with the results of the stat() call. I suppose that extending fts_read() to also respect the exclusion list would be fairly invasive. Alternatively, the EPERM could persist during the fts_read(), but then be somehow "forgotten about" later for excluded files, allowing the exit status to return to being 0 (assuming no other genuine errors).

Kevin Pulo <devkev>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by devkev (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup