[HELP] Go-fuse Rmdir problem

117 views
Skip to first unread message

Archer F

unread,
Mar 23, 2012, 3:05:56 AM3/23/12
to golan...@googlegroups.com
Dear all:

i have only implememted   FileSystem interface and File interface

then i have a test:
$ mkdir a
$ mkdir a/b
$ rm -r a
rm: cannot remove `a/b': No such file or directory
is there anything i missed to do?

here is the log:
the log of mine is from my functions
  1. 2012/03/23 14:58:46 Dispatch: LOOKUP, NodeId: 1. names: [a] 2 bytes
  2. get attr : a &{{1000 1000} 27027}
  3. 2012/03/23 14:58:46 Serialize: LOOKUP code: OK value: {70368878479792 E1.000000000 A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:70368878479792 A 0.000000000 M 0.000000000 C 0.000000000}}
  4. 2012/03/23 14:58:46 Dispatch: ACCESS, NodeId: 70368878479792. data: {w}
  5. 2012/03/23 14:58:46 Serialize: ACCESS code: OK value:
  6. 2012/03/23 14:58:46 Dispatch: OPENDIR, NodeId: 70368878479792.
  7. open dir : a &{{1000 1000} 27027}
  8. 2012/03/23 14:58:46 Serialize: OPENDIR code: OK value:
  9. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 70368878479792. data: {Fh 70368878477924 off 0 sz 4096  L 0 NONBLOCK,0x28000}
  10. 2012/03/23 14:58:46 Serialize: READDIR code: OK value:  96 bytes data
  11. 2012/03/23 14:58:46 Dispatch: LOOKUP, NodeId: 70368878479792. names: [b] 2 bytes
  12. get attr : a/b &{{1000 1000} 27027}
  13. 2012/03/23 14:58:46 Serialize: LOOKUP code: OK value: {105553250621824 E1.000000000 A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:105553250621824 A 0.000000000 M 0.000000000 C 0.000000000}}
  14. 2012/03/23 14:58:46 Dispatch: ACCESS, NodeId: 105553250621824. data: {w}
  15. 2012/03/23 14:58:46 Serialize: ACCESS code: OK value:
  16. 2012/03/23 14:58:46 Dispatch: OPENDIR, NodeId: 105553250621824.
  17. open dir : a/b &{{1000 1000} 27027}
  18. 2012/03/23 14:58:46 Serialize: OPENDIR code: OK value:
  19. 2012/03/23 14:58:46 Dispatch: RELEASEDIR, NodeId: 70368878479792. data: {Fh 70368878477924 NONBLOCK,0x28000  L0}
  20. 2012/03/23 14:58:46 Serialize: RELEASEDIR code: OK value:
  21. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 105553250621824. data: {Fh 105553250566796 off 0 sz 4096  L 0 NONBLOCK,0x28000}
  22. 2012/03/23 14:58:46 Serialize: READDIR code: OK value:  64 bytes data
  23. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 105553250621824. data: {Fh 105553250566796 off 2 sz 4096  L 0 NONBLOCK,0x28000}
  24. 2012/03/23 14:58:46 Serialize: READDIR code: OK value:
  25. 2012/03/23 14:58:46 Dispatch: OPENDIR, NodeId: 70368878479792.
  26. open dir : a &{{1000 1000} 27027}
  27. 2012/03/23 14:58:46 Serialize: OPENDIR code: OK value:
  28. 2012/03/23 14:58:46 Dispatch: RELEASEDIR, NodeId: 105553250621824. data: {Fh 105553250566796 NONBLOCK,0x28000  L0}
  29. 2012/03/23 14:58:46 Serialize: RELEASEDIR code: OK value:
  30. 2012/03/23 14:58:46 Dispatch: GETATTR, NodeId: 70368878479792. data: {Fh 0}
  31. get attr : a &{{1000 1000} 27027}
  32. 2012/03/23 14:58:46 Serialize: GETATTR code: OK value: {A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:70368878479792 A 0.000000000 M 0.000000000 C 0.000000000}}
  33. 2012/03/23 14:58:46 Dispatch: GETATTR, NodeId: 105553250621824. data: {Fh 0}
  34. get attr : a/b &{{1000 1000} 27027}
  35. 2012/03/23 14:58:46 Serialize: GETATTR code: OK value: {A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:105553250621824 A 0.000000000 M 0.000000000 C 0.000000000}}
  36. 2012/03/23 14:58:46 Dispatch: ACCESS, NodeId: 105553250621824. data: {w}
  37. 2012/03/23 14:58:46 Serialize: ACCESS code: OK value:
  38. 2012/03/23 14:58:46 Dispatch: RMDIR, NodeId: 70368878479792. names: [b] 2 bytes
  39. rmdir a/b
  40. 2012/03/23 14:58:46 url http://10.0.0.101:9300/delete/L2EvYg==
  41. 2012/03/23 14:58:46 &{200 OK 200 HTTP/1.1 1 1 map[Content-Length:[0] Date:[Fri, 23 Mar 2012 07:00:31 GMT] Content-Type:[application/json]] 0xf84018f540 0 [] false map[] 0xf84018c0c0}
  42. 2012/03/23 14:58:46 Serialize: RMDIR code: OK value:
  43. 2012/03/23 14:58:46 Dispatch: FORGET, NodeId: 105553250621824. data: &{2}
  44. 2012/03/23 14:58:46 Dispatch: GETATTR, NodeId: 70368878479792. data: {Fh 0}
  45. get attr : a &{{1000 1000} 27027}
  46. 2012/03/23 14:58:46 Serialize: GETATTR code: OK value: {A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:70368878479792 A 0.000000000 M 0.000000000 C 0.000000000}}
  47. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 70368878479792. data: {Fh 140737622655678 off 0 sz 4096  L 0 RDONLY,0x8000}
  48. 2012/03/23 14:58:46 Serialize: READDIR code: OK value:  96 bytes data
  49. 2012/03/23 14:58:46 Dispatch: LOOKUP, NodeId: 70368878479792. names: [b] 2 bytes
  50. get attr : a/b &{{1000 1000} 27027}
  51. already deleted
  52. 2012/03/23 14:58:46 Serialize: LOOKUP code: 2=no such file or directory value:
  53. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 70368878479792. data: {Fh 140737622655678 off 3 sz 4096  L 0 RDONLY,0x8000}
  54. 2012/03/23 14:58:46 Serialize: READDIR code: OK value:
  55. 2012/03/23 14:58:46 Dispatch: RELEASEDIR, NodeId: 70368878479792. data: {Fh 140737622655678 0x8000  L0}
  56. 2012/03/23 14:58:46 Serialize: RELEASEDIR code: OK value:

Han-Wen Nienhuys

unread,
Mar 23, 2012, 9:08:04 AM3/23/12
to golan...@googlegroups.com


Em sexta-feira, 23 de março de 2012 04h05min56s UTC-3, Archer F escreveu:
Dear all:

i have only implememted   FileSystem interface and File interface

then i have a test:
$ mkdir a
$ mkdir a/b
$ rm -r a
rm: cannot remove `a/b': No such file or directory
is there anything i missed to do?


What version of rm are you using?  GNU Coreutils before 8.x has non-posix directory traversal code, so it doesn't execute rm -r correctly.

Sordid details at 


 

Han-Wen Nienhuys

unread,
Mar 26, 2012, 12:14:36 AM3/26/12
to golan...@googlegroups.com


Em sexta-feira, 23 de março de 2012 04h05min56s UTC-3, Archer F escreveu:
Dear all:

i have only implememted   FileSystem interface and File interface

 

your log shows: 
  1. 2012/03/23 14:58:46 Serialize: READDIR code: OK value: 2012/03/23 14:58:46 Dispatch: OPENDIR, NodeId: 70368878479792.
  2. open dir : a &{{1000 1000} 27027}

open dir a ..

..

  1. 2012/03/23 14:58:46 Dispatch: ACCESS, NodeId: 105553250621824. data: {w}
  2. 2012/03/23 14:58:46 Serialize: ACCESS code: OK value:
  3. 2012/03/23 14:58:46 Dispatch: RMDIR, NodeId: 70368878479792. names: [b] 2 bytes

delete b
 
  1. rmdir a/b
  2. 2012/03/23 14:58:46 url http://10.0.0.101:9300/delete/​L2EvYg==
  3. 2012/03/23 14:58:46 &{200 OK 200 HTTP/1.1 1 1 map[Content-Length:[0] Date:[Fri, 23 Mar 2012 07:00:31 GMT] Content-Type:[application/​json]] 0xf84018f540 0 [] false map[] 0xf84018c0c0}
  4. 2012/03/23 14:58:46 Serialize: RMDIR code: OK value:
  5. 2012/03/23 14:58:46 Dispatch: FORGET, NodeId: 105553250621824. data: &{2}
  6. 2012/03/23 14:58:46 Dispatch: GETATTR, NodeId: 70368878479792. data: {Fh 0}
  7. get attr : a &{{1000 1000} 27027}
  8. 2012/03/23 14:58:46 Serialize: GETATTR code: OK value: {A1.000000000 {M040755 S=0 L=0 0:0 0*0 0:70368878479792 A 0.000000000 M 0.000000000 C 0.000000000}}
  9. 2012/03/23 14:58:46 Dispatch: READDIR, NodeId: 70368878479792. data: {Fh 140737622655678 off 0 sz 4096  L 0 RDONLY,0x8000}

readdir in a.

The remove happens between opendir and readdir, and your userspace program is -incorrectly- assuming the readdir will reflect the removal.

I tried installing coreutils 8.14, but could not duplicate your complaint, but I have seen similar problems with 7.x.
 

Reply all
Reply to author
Forward
0 new messages