[Bugs] [Bug 1789679] New: glusterfs behave differently from nfs in case of bind mount

bugzilla at redhat.com bugzilla at redhat.com
Fri Jan 10 05:39:59 UTC 2020


https://bugzilla.redhat.com/show_bug.cgi?id=1789679

            Bug ID: 1789679
           Summary: glusterfs behave differently from nfs in case of bind
                    mount
           Product: GlusterFS
           Version: 7
          Hardware: x86_64
                OS: Linux
            Status: NEW
         Component: fuse
          Severity: medium
          Assignee: bugs at gluster.org
          Reporter: zz.sh.cynthia at gmail.com
                CC: bugs at gluster.org
  Target Milestone: ---
    Classification: Community



Description of problem:
remove bind mount source file and then visit bind mount target file, bind mount
target file return stale file handle. this behaviour is different from nfs, is
this a bug or glusterfs is designed to be like this?

Version-Release number of selected component (if applicable):
glusterfs7.0

How reproducible:


Steps to Reproduce:
1.touch a b write some content to file a and b
2.mount --bind a b
3.rm a
4.cat b will show stale file handle

Actual results:
cat b return "Stale file handle"

Expected results:
cat b could show content of file a


/////////////////glusterfs log/////////////////
[root at mn-0:/mnt/mstate]
# touch testa testb
[root at mn-0:/mnt/mstate]
# echo "testa">testa
[root at mn-0:/mnt/mstate]
# echo "testb">testb
[root at mn-0:/mnt/mstate]
# stat testa testb
  File: testa
  Size: 6               Blocks: 1          IO Block: 131072 regular file
Device: 2ch/44d Inode: 10882777708173043205  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-10 07:27:27.158101292 +0200
Modify: 2020-01-10 07:27:31.359540858 +0200
Change: 2020-01-10 07:27:31.359540858 +0200
 Birth: -
  File: testb
  Size: 6               Blocks: 1          IO Block: 131072 regular file
Device: 2ch/44d Inode: 9880227614551106819  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-10 07:27:27.168101297 +0200
Modify: 2020-01-10 07:27:35.848930005 +0200
Change: 2020-01-10 07:27:35.848930005 +0200
 Birth: -
[root at mn-0:/mnt/mstate]
# mount --bind testa testb
[root at mn-0:/mnt/mstate]
# stat testa testb
  File: testa
  Size: 6               Blocks: 1          IO Block: 131072 regular file
Device: 2ch/44d Inode: 10882777708173043205  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-10 07:27:27.158101292 +0200
Modify: 2020-01-10 07:27:31.359540858 +0200
Change: 2020-01-10 07:27:31.359540858 +0200
 Birth: -
  File: testb
  Size: 6               Blocks: 1          IO Block: 131072 regular file
Device: 2ch/44d Inode: 10882777708173043205  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-10 07:27:27.158101292 +0200
Modify: 2020-01-10 07:27:31.359540858 +0200
Change: 2020-01-10 07:27:31.359540858 +0200
 Birth: -
[root at mn-0:/mnt/mstate]
# rm testa
[root at mn-0:/mnt/mstate]
# cat testb
cat: testb: Stale file handle
[root at mn-0:/mnt/mstate]
# stat testa testb
stat: cannot stat 'testa': No such file or directory
stat: cannot stat 'testb': Stale file handle
[root at mn-0:/mnt/mstate]

/////////////////////////nfs log/////////////////////

Additional info:
for nfs:
[root at as-0:/mnt/export]
# touch aaaa bbbb
[root at as-0:/mnt/export]
# echo "testa">aaaa
[root at as-0:/mnt/export]
# echo "testb">bbbb
[root at as-0:/mnt/export]
# mount --bind aaaa bbbb
[root at as-0:/mnt/export]
# stat aaaa bbbb
  File: aaaa
  Size: 6               Blocks: 8          IO Block: 524288 regular file
Device: 27h/39d Inode: 18          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: ( 
615/_nokfsuifileshare)
Access: 2020-01-10 11:18:32.610946394 +0800
Modify: 2020-01-10 11:18:38.179982981 +0800
Change: 2020-01-10 11:18:38.179982981 +0800
 Birth: -
  File: bbbb
  Size: 6               Blocks: 8          IO Block: 524288 regular file
Device: 27h/39d Inode: 18          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: ( 
615/_nokfsuifileshare)
Access: 2020-01-10 11:18:32.610946394 +0800
Modify: 2020-01-10 11:18:38.179982981 +0800
Change: 2020-01-10 11:18:38.179982981 +0800
 Birth: -
[root at as-0:/mnt/export]
# rm aaaa
[root at as-0:/mnt/export]
# stat aaaa bbbb
stat: cannot stat 'aaaa': No such file or directory
  File: bbbb
  Size: 6               Blocks: 8          IO Block: 524288 regular file
Device: 27h/39d Inode: 18          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: ( 
615/_nokfsuifileshare)
Access: 2020-01-10 11:18:32.610946394 +0800
Modify: 2020-01-10 11:18:38.179982981 +0800
Change: 2020-01-10 11:19:06.350160327 +0800
 Birth: -
[root at as-0:/mnt/export]
# cat aaaa bbbb
cat: aaaa: No such file or directory
testa


Analysis:
for glusterfs rm a will really remove a from brick even when file b is bind
mount to a, but from nfs side, when remove a there are still b

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list