-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Prevent extraneous fstat during open() #65878
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
Comments
Hi, |
Thanks a lot for the code review! I'm attaching a revised version of the patch. Fixes I made:
I hope attaching the version 2 of the patch here is ok, if I should have attached it in the code review tool somehow, please let me know. |
Again, thanks for the review. It's true that HAVE_FSTAT can be defined without stat structure containing st_blksize. I added an ifdef HAVE_STRUCT_STAT_ST_BLKSIZE for that. Attaching third version of the patch, hopefully everything will be ok now. |
So, as pointed out by haypo, blksize_t is actually signed long on Linux. This means that my patch (as well as the current code) is not right. Thanks a lot. |
I think it's ok to keep the block size an int for now. It would be surprising for a block size to be more than 2 GB, IMO. |
Thanks, Antoine. So, is there anything else that should be done about the patch so that it gets accepted? |
I'm attaching fourth version of the patch. Changes:
|
New changeset 3b5279b5bfd1 by Antoine Pitrou in branch 'default': |
Thank you very much. I've committed the patch to the default branch (I've just moved the _blksize test to a separate method). |
The change made here no longer tolerates fstat() returning an error, which seems to be the cause of bpo-25717. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: