There is a potential space leak problem while linking tmpfile, in which case, inode node(with nlink=0) is valid in tnc (on flash), which leads to space leak. Meanwhile, the corresponding data nodes won't be released from tnc. The reproducer: Step 1. Apply reproduce.patch Step 2. mount **fresh** ubifs on '/root/temp' Step 3. gcc -o aa a.c Step 4. ./aa && dmesg [ 3810.325408] NOT FOUND [ 3811.215275] COMMIT START [ 3811.216363] orphan commit orpahns 1 [ 3811.217532] commmit noorphan 0 [ 3811.218545] COMMIT END [ 3811.222095] total orphans 0 [ 3811.223224] COMMIT START [ 3811.224177] orphan commit orpahns 0 [ 3811.225450] commmit noorphan 1 [ 3811.226586] COMMIT END [ 3811.227350] delete 65 from orphan Step 5. Manually powercut when see 'delete 65 from orphan' in dmesg Step 6. mount ubifs [ 3863.152517] COMMIT START [ 3863.152901] orphan commit orpahns 0 [ 3863.153491] commmit noorphan 1 [ 3863.153920] COMMIT END [ 3863.154256] UBIFS (ubi0:0): recovery completed [ 3863.154455] Found 65 0 # Find inode 65, nlink=0
Created attachment 290021 [details] reproduce.patch
Created attachment 290023 [details] a.c
New reproducer: 1. Apply diff 2. ./test.sh 1 3. powercut when you see "Do powercut" 4. ./test.sh df stat (Used 54M) Filesystem Type Size Used Avail Use% Mounted on /dev/ubi0_0 ubifs 110M 54M 52M 51% /root/temp du stat (Used 0 bytes) 0 /root/temp/dir 0 /root/temp/f2
Created attachment 306072 [details] diff
Created attachment 306073 [details] a.c
Created attachment 306074 [details] test.sh