bugfindutils - Bugs: bug #24342, -inum predicate shoud use...

 
 

bug #24342: -inum predicate shoud use dirent.d_ino instead of stat.st_ino

Submitted by:  None
Submitted on:  Mon 22 Sep 2008 08:34:30 AM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: George SpelvinOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.4.0
Fixed Release: 4.5.4

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 08 Mar 2009 12:26:03 PM UTC, comment #2:

The updated patches are what I actually pushed (into 4.5.x).

(file #17618, file #17619)

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 07 Mar 2009 09:09:07 PM UTC, comment #1:

The attached patches (against 4.5.x) should fix this performance bug.

(file #17615, file #17616)

James Youngman <jay>
Project AdministratorIn charge of this item.
Mon 22 Sep 2008 08:34:30 AM UTC, original submission:

Having to stat(2) files to evaluate the -inum predicate

While looking for files corresponding to fsck complaints, I noticed that "find . \( -inum x -o -inum y -o -inum z \) -print" is quite slow, due to making a stat() call on every file.

The predicate is indeed marked NeedsStatInfo in tree.c, but it's not clear why it doesn't use d_ino from the readdir call. (Although changing it appears to require messing with lib/savedirinfo.c)

The one gotcha is with mount points, which have two inode numbers: d_ino is the covered inode number, while st_ino is the covering inode number. However, eliminating stat() on non-directories would still be an enormous help, and find(1) already has extensive support for avoiding stat() calls on non-directories that can be used.

(Linux bind mounts allow you to mount a single file, but in that case d_ino holds the covering inode number; verified in 2.6.26.)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16538:  findi.c added by None (0B - application/octet-stream - A simple utility that finds on inode number, demonstrating the desired efficiency.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated the item)
  • -unavailable- added by None (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):

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 06 Jul 2009 10:58:15 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.4
    Sun 08 Mar 2009 12:26:03 PM UTCjayAttached File-=>Added 0001-Optimise-away-calls-to-stat-if-all-we-need-is-the-in.patch, #17618
      Attached File-=>Added 0002-For-samefile-skip-stat-if-inode-numbers-differ.patch, #17619
      StatusNone=>Fixed
    Sun 08 Mar 2009 12:24:27 PM UTCjayAttached File#17616=>Removed
    Sun 08 Mar 2009 12:24:20 PM UTCjayAttached File#17615=>Removed
    Sat 07 Mar 2009 09:09:29 PM UTCjayAssigned toNone=>jay
    Sat 07 Mar 2009 09:09:07 PM UTCjayAttached File-=>Added 0001-Optimise-away-calls-to-stat-if-all-we-need-is-the-in.patch, #17615
      Attached File-=>Added 0002-For-samefile-skip-stat-if-inode-numbers-differ.patch, #17616
    Mon 22 Sep 2008 08:34:30 AM UTCNoneAttached File-=>Added findi.c, #16538

    Back to the top


    Powered by Savane 3.1-cleanup1