forked from awslabs/mountpoint-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow repeated readdir offsets (awslabs#581)
* Allow repeated readdir offsets POSIX allows seeking an open directory handle, which in FUSE means the `offset` can be any offset we've previously returned. This is pretty annoying for us to implement since we're streaming directory entries from S3 with ListObjects, which can't resume from an arbitrary index, and can't fit its continuation tokens into a 64-bit offset anyway. So we're probably never going to truly support seeking a directory handle. But there's a special case we've seen come up a couple of times (awslabs#477, awslabs#520): some applications read one page of directory entries and then seek back to 0 and do it again. I don't fully understand _why_ they do this, but it's common enough that it's worth special casing. This change makes open directory handles remember their most recent response so that they can repeat it if asked for the same offset again. It's not too complicated other than needing to make sure we do readdirplus correctly (managing the lookup counts for entries that are being returned a second time). I've tested this by running the PHP example from awslabs#477, which now works. Signed-off-by: James Bornholt <[email protected]> * PR feedback Signed-off-by: James Bornholt <[email protected]> * Changelog and docs Signed-off-by: James Bornholt <[email protected]> --------- Signed-off-by: James Bornholt <[email protected]>
- Loading branch information
1 parent
04f7499
commit 8e5688d
Showing
7 changed files
with
219 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.