cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.12k stars 605 forks source link

rofs/rofs_cache: use both inode_no and sb as key in the cache hashmap #1220

Closed valighita closed 1 year ago

valighita commented 1 year ago

The ROFS cache map is global and not unique per mount and the entries are currently indexed only by inode_no. If there are multiple ROFS mounts, reading from the cache will produce wrong results when there are files having the same inode_no in different mounts.

To address this issue, use both the inode_no and the superblock pointer as the key in the cache map.

wkozaczuk commented 1 year ago

Good catch! I see no issues with your MR and all tests pass (./scripts/build check) so I am merging it.

nyh commented 1 year ago

@wkozaczuk this commit got the committer name Commit: GitHub <noreply@github.com> (you can see this with git log --pretty=full). There is no mention of your name, or this PR. I wonder if we can do something better for a more reasonable git history... Or this is unfortunately the best that github knows to do with its "merge" button :-(

wkozaczuk commented 1 year ago

It is unfortunate. I have merged the last two PRs with "merge + squash". But I looked at the other one where I did not do squash and the same thing: Commit: GitHub @.***>.

I wonder if there is some setting we can apply that would fix it. Or maybe something has to specifically toggled when applying the "Merge".

On Mon, Mar 20, 2023 at 12:58 PM nyh @.***> wrote:

@wkozaczuk https://github.com/wkozaczuk this commit got the committer name Commit: GitHub @.***> (you can see this with git log --pretty=full). There is no mention of your name, or this PR. I wonder if we can do something better for a more reasonable git history... Or this is unfortunately the best that github knows to do with its "merge" button :-(

— Reply to this email directly, view it on GitHub https://github.com/cloudius-systems/osv/pull/1220#issuecomment-1476604810, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABINEIMY4QEMM6ABIAO6URLW5CEEFANCNFSM6AAAAAAV45RSFM . You are receiving this because you were mentioned.Message ID: @.***>