GoogleCloudPlatform / gcsfuse

A user-space file system for interacting with Google Cloud Storage
https://cloud.google.com/storage/docs/gcs-fuse
Apache License 2.0
2.04k stars 421 forks source link

Fix DeadLock in Kernel List Cache Feature #2100

Closed raj-prince closed 2 months ago

raj-prince commented 3 months ago

Description

When It happens when two parallel calls OpenDir and LookUpInode comes for the same directory.

Why When kernel-list-cache is enabled (means ttl > 0), we were not following Lock ordering for dirInode and fs. Ideally, we should acquire dirInode lock first, but it was opposite. Fixing the order solves the issue.

Link to the issue in case of a bug fix.

2104

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.42%. Comparing base (43e4b64) to head (ceb292e). Report is 8 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2100 +/- ## ========================================== - Coverage 71.93% 70.42% -1.51% ========================================== Files 101 101 Lines 10996 11937 +941 ========================================== + Hits 7910 8407 +497 - Misses 2758 3194 +436 - Partials 328 336 +8 ``` | [Flag](https://app.codecov.io/gh/GoogleCloudPlatform/gcsfuse/pull/2100/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleCloudPlatform) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/GoogleCloudPlatform/gcsfuse/pull/2100/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleCloudPlatform) | `70.42% <100.00%> (-1.51%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleCloudPlatform#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.