rpodgorny / unionfs-fuse

union filesystem using fuse
Other
296 stars 76 forks source link

error usage of errno find_branch() #63

Open wonlinwo opened 7 years ago

wonlinwo commented 7 years ago

hi, when i do a stress test which unionfs bind a ramfs directory and ubifs directory, enable debug option(-d),

unique: 895588, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 12588 LOOKUP /type_a.checksum getattr /type_a.checksum unionfs_getattr(): 197: /type_a.checksum find_rorw_branch(): 107: /type_a.checksum find_branch(): 58: /type_a.checksum build_path(): 131: from: find_branch():63 path: /mnt/persistent/app_data/lt_default/type_a.checksum build_path(): 132: return 0 find_branch(): 71: /mnt/persistent/app_data/lt_default/type_a.checksum: res = -1 path_hidden(): 58: /type_a.checksum build_path(): 131: from: path_hidden():63 path: /mnt/persistent/app_data/lt_default/.unionfs/type_a.checksum build_path(): 132: return 0 filedir_hidden(): 45: /mnt/persistent/app_data/lt_default/.unionfs/type_a.checksum_HIDDEN~ filedir_hidden(): 51: return 0 path_hidden(): 86: return 0 build_path(): 131: from: find_branch():63 path: /isam/slot_default/run.volatile/type_a.checksum build_path(): 132: return 0 find_branch(): 71: /isam/slot_default/run.volatile/type_a.checksum: res = -1 path_hidden(): 58: /type_a.checksum build_path(): 131: from: path_hidden():63 path: /isam/slot_default/run.volatile/.unionfs/type_a.checksum build_path(): 132: return 0 filedir_hidden(): 45: /isam/slot_default/run.volatile/.unionfs/type_a.checksum_HIDDEN~ filedir_hidden(): 51: return 0 path_hidden(): 86: return 0 find_branch(): 100: return -1 find_rorw_branch(): 109: return -1 unionfs_getattr(): 200: return -28 lookup_path type_a.checksum, /type_a.checksum unique: 895588, error: -28 (No space left on device), outsize: 16

########################################################## find_branch(): 100: return -1 and set errno to ENOENT, but but caller unionfs_getattr(): 200: return -28

i think when enable debug option, errno may change during DBG() execute.

maybe other code also have errno issue.

thanks

rpodgorny commented 7 years ago

interesting. thanks for the report!

according to documentation, it seems the the fflush may by the culprit (neither fprintf nor pthreadrwlock* doesn't seem to be altering errno).

how can i try to reproduce your stress test?

wonlinwo commented 7 years ago

I do stress on an embedded board, open -d option and configure debug file to /tmp/unionfs_debug.log. due to root file system size limitation, i found when error happen, /tmp/unionfs_debug.log will not increase.