Skip to content
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

The length of the file written by the mount point is not updated #1845

Closed
YunhuiChen opened this issue Aug 19, 2022 · 1 comment
Closed

The length of the file written by the mount point is not updated #1845

YunhuiChen opened this issue Aug 19, 2022 · 1 comment
Assignees
Labels
bug Something isn't working need test Completion of development, requires QA verification

Comments

@YunhuiChen
Copy link
Contributor

Describe the bug (描述bug)

The length of the file written by the mount point is not updated

To Reproduce (复现方法)
1、mount fs1 -> test1 fs1 -> test2
2、echo a > test1/a
3、cat test2/a -> a
4、echo b >> test1/a
sleep 5mins
5、cat test2/a -> a
6、umount test5 test6 / mount test5 test6

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
branch:
commit id:

Additional context/screenshots (更多上下文/截图)

@YunhuiChen YunhuiChen added the bug Something isn't working label Aug 19, 2022
@YunhuiChen YunhuiChen added this to the Curve-2.4.0-beta milestone Aug 19, 2022
@wu-hanqing
Copy link
Contributor

wu-hanqing commented Aug 19, 2022

here is a workflow that can reproduce this problem,

           mount_1        │     mount_2
──────────────────────────┼───────────────────────────
                          │
    1. echo "a" > file    │
                          │
    2. cat file           │
       > a                │
                          │   3. cat file
                          │      > a
                          │
    4. echo "a" >> file   │
                          │
                          │
                          │   5. cat file
                          │      > a
                          │
    6. cat file           │
       > a                │
         a                │
                          │   7. cat file
                          │      > a
                          │
    8. umount & remount   │
                          │
                          │
    9. cat file           │
       > a                │

step 9 should output double a like step 6, but it doesn't, because file's length is still 2 instead of 4.

The reason is:

  1. we mount a filesystem twice but disable close-to-open guarantee
  2. cat file makes the inode dirty in the cache, which means it will update metadata to metaserver, and this leads to the inode's length changing from 4 to 2 in metaserver.

@wuhongsong wuhongsong added the need test Completion of development, requires QA verification label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need test Completion of development, requires QA verification
Projects
None yet
Development

No branches or pull requests

3 participants