mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
7efc34b53b
The tmpfile could be added into orphan list twice, first time is
creation, the second time is removing after it is linked. The orphan
entry could be added twice for tmpfile if following sequence is
satisfied:
ubifs_tmpfile
ubifs_jnl_update
ubifs_add_orphan // first time to add orphan entry
P1 P2
ubifs_link do_commit
ubifs_orphan_start_commit
orphan->cmt = 1
ubifs_delete_orphan
orphan_delete
if (orph->cmt)
orph->del = 1; // orphan entry is not deleted from tree
return
ubifs_unlink
ubifs_jnl_update
ubifs_add_orphan
orphan_add // found old orphan entry, second time to add orphan entry
ubifs_err(c, "orphaned twice")
return -EINVAL // unlink failed!
ubifs_orphan_end_commit
erase_deleted // delete old orphan entry
rb_erase(&orphan->rb, &c->orph_tree)
Fix it by removing orphan entry from orphan tree in advance, rather than
remove it from orphan tree in committing process.
Fixes:
|
||
---|---|---|
.. | ||
auth.c | ||
budget.c | ||
commit.c | ||
compress.c | ||
crypto.c | ||
debug.c | ||
debug.h | ||
dir.c | ||
file.c | ||
find.c | ||
gc.c | ||
io.c | ||
ioctl.c | ||
journal.c | ||
Kconfig | ||
key.h | ||
log.c | ||
lprops.c | ||
lpt_commit.c | ||
lpt.c | ||
Makefile | ||
master.c | ||
misc.c | ||
misc.h | ||
orphan.c | ||
recovery.c | ||
replay.c | ||
sb.c | ||
scan.c | ||
shrinker.c | ||
super.c | ||
sysfs.c | ||
tnc_commit.c | ||
tnc_misc.c | ||
tnc.c | ||
ubifs-media.h | ||
ubifs.h | ||
xattr.c |