-
Notifications
You must be signed in to change notification settings - Fork 66
Bug: not update node directory tree info after rename operation #57
Description
Hi,
When using hdfs-mount,i find a bug. If exec mv one file to one directory, then read that file. It will occur Input/output error. Only if you do ls conmand, update the nodes attribution, read it successfully. Occuring this bug , because rename oporation changes the file entries cache, but not change corresponding global variable *fs.Server.node attribution.
Recurrence process:
touch 1.txt
ls
mv 1.txt test/
cat test/1.txt # test is a child directory
The client log:
[xzy]# ls
1.sh test
[xzy]# touch 1.txt
[xzy]# ls
1.sh 1.txt test
[xzy]# mv 1.txt test
[xzy]# cat test/1.txt <--------------- not click tab for automatic completion
cat: test/1.txt: Input/output error
The hdfs-mount service log:
Warning: 2019/11/16 18:49:07 Dir.go:187: stat [1.txt]: stat /xuezhiyou/xzy/1.txt: file does not existstat /xuezhiyou/xzy/1.txt: file does not exist
INFO: 2019/11/16 18:49:07 [ /xuezhiyou/xzy/1.txt ] Create -rw-r--r--
INFO: 2019/11/16 18:49:07 newFile= true
INFO: 2019/11/16 18:49:07 This staging file name:/var/hdfs-mount/xuezhiyou/xzy/1.txt
INFO: 2019/11/16 18:49:07 [ /xuezhiyou/xzy/1.txt ] flush ( 0 new bytes written)
INFO: 2019/11/16 18:49:07 [ /xuezhiyou/xzy/1.txt ] flush ( 0 new bytes written)
INFO: 2019/11/16 18:49:07 [ /xuezhiyou/xzy/1.txt ] Close/Write: err=
INFO: 2019/11/16 18:49:08 [ /xuezhiyou/xzy ]ReadDirAll
Warning: 2019/11/16 18:49:16 Dir.go:187: stat [1.txt]: stat /xuezhiyou/xzy/test/1.txt: file does not existstat /xuezhiyou/xzy/test/1.txt: file does not exist
Warning: 2019/11/16 18:49:16 Dir.go:187: stat [1.txt]: stat /xuezhiyou/xzy/test/1.txt: file does not existstat /xuezhiyou/xzy/test/1.txt: file does not exist
INFO: 2019/11/16 18:49:16 Rename [ /xuezhiyou/xzy/1.txt ] to /xuezhiyou/xzy/test/1.txt
INFO: 2019/11/16 18:49:24 Open: /xuezhiyou/test/1.txt OpenReadOnly
Error: 2019/11/16 18:49:24 FileHandleReader.go:35: [ /xuezhiyou/test/1.txt ] Opening: open /xuezhiyou/test/1.txt: file does not exist
I fix this bug. The git diff look at commit aa603121e8650d53893fdd43f98673353d106b0a
Because i use dep for managing the dependcies and modify fuse.server.go for getting node entity by inode. I do not commit a pull request.