-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSFS | Improve list objects performance on top of NS FS (PR 1/3) #7912
Conversation
@naveenpaul1 let's add some tests? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naveenpaul1 This is great!
It would be great to see the performance improvement from the full impl.
See few comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small comments but otherwise looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First - we need to switch to BigInt - see #7912 (comment)
Second - I see that readdir also returns the same position that telldir returns as d_off
-
https://man7.org/linux/man-pages/man3/readdir.3.html
So we should also return this number (as bigint) from our dir.read() call so that we don't have to call telldir again if we just read the last entry where we want to pause. This means we should add it to our struct Entry (in this file).
I am copying here some findings that I want to keep in mind when implementing list objects using this. It seems that on BSD the docs for telldir/seekdir say that the position is only valid for the lifetime of the dir handle and once it closes the positions are no longer valid to use: https://man.freebsd.org/cgi/man.cgi?query=seekdir
This article describes a bug that was hidden in BSD implementation of telldir for 25 years until it was found by samba users - https://marcbalmer.ch/when-seekdir-wont-seek-to-the-right-position-a9e2b1986203 In Linux the docs do not specifically say for how long the positions returned by telldir are valid, so it might be that different filesystems will interpret those docs differently. Overall, I think we should be careful here, and enable the optimization only when we know for sure that the filesystem and the kernel supports stable dir positions even using unrelated dir handles. |
Signed-off-by: naveenpaul1 <napaul@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Lets get it merged.
Explain the changes
telldir
andseekdir
methods in napi layerIssues: Fixed #xxx / Gap #xxx
Testing Instructions: