diff options
author | Guochun Mao <guochun.mao@mediatek.com> | 2021-03-16 16:52:14 +0800 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2021-04-15 21:59:23 +0200 |
commit | 3e903315790baf4a966436e7f32e9c97864570ac (patch) | |
tree | ef83c2370084e7f9d91c7e759a83720b6b583578 /fs/fs_context.c | |
parent | d434405aaab7d0ebc516b68a8fc4100922d7f5ef (diff) |
ubifs: Only check replay with inode type to judge if inode linked
Conside the following case, it just write a big file into flash,
when complete writing, delete the file, and then power off promptly.
Next time power on, we'll get a replay list like:
...
LEB 1105:211344 len 4144 deletion 0 sqnum 428783 key type 1 inode 80
LEB 15:233544 len 160 deletion 1 sqnum 428785 key type 0 inode 80
LEB 1105:215488 len 4144 deletion 0 sqnum 428787 key type 1 inode 80
...
In the replay list, data nodes' deletion are 0, and the inode node's
deletion is 1. In current logic, the file's dentry will be removed,
but inode and the flash space it occupied will be reserved.
User will see that much free space been disappeared.
We only need to check the deletion value of the following inode type
node of the replay entry.
Fixes: e58725d51fa8 ("ubifs: Handle re-linking of inodes correctly while recovery")
Cc: stable@vger.kernel.org
Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/fs_context.c')
0 files changed, 0 insertions, 0 deletions