From: Boaz Harrosh Date: Tue, 14 Jan 2014 14:05:52 +0000 (+0200) Subject: exofs: Allow corrupted directory entry to be empty file X-Git-Tag: firefly_0821_release~176^2~4548^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c8592fcc66b2fe9cbd505f1faff810f8844d4a97;p=firefly-linux-kernel-4.4.55.git exofs: Allow corrupted directory entry to be empty file If there was an error in fetching an object or extracting inode info from attributes. Which means corrupted storage. Let it be an empty ZERO dated directory entry so it can be deleted. Otherwise the all directory will be inaccessible. This does not loose data, because if there is an orphan object somewhere it will be recovered by fschk. But usually this only means corrupted dir entry. The object was never generated and only its link exist. This way we can delete the bad entry. Signed-off-by: Boaz Harrosh --- diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 7e7ba9ada405..390224a162d0 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c @@ -1102,8 +1102,7 @@ static int exofs_get_inode(struct super_block *sb, struct exofs_i_info *oi, /* If object is lost on target we might as well enable it's * delete. */ - if ((ret == -ENOENT) || (ret == -EINVAL)) - ret = 0; + ret = 0; goto out; }