linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list
@ 2018-11-19  6:02 Ritesh Harjani
  2018-11-19  6:02 ` [PATCH 2/2] f2fs: Set CP_ERROR_FLAG in case of inconsistent node page entries Ritesh Harjani
  2018-11-19  6:39 ` [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list Chao Yu
  0 siblings, 2 replies; 10+ messages in thread
From: Ritesh Harjani @ 2018-11-19  6:02 UTC (permalink / raw)
  To: linux-f2fs-devel, jaegeuk, yuchao0

This is seen when CP_ERROR_FLAG is not set & FS may be corrupted.
There is a case observed where dirty stale inode pointer data is still
present in the gdirty_list causing panic on access while doing
checkpoint operation.

WARNING: CPU: 3 PID: 1827 at
kernel/msm-4.14/fs/f2fs/inode.c:567
f2fs_evict_inode+0x364/0x37c
<...>
[42246.776289] BUG: spinlock bad magic on CPU#4, 1245
[42246.782674] Unable to handle kernel paging request at virtual address 6b6b6b6b6b713b
<...>
[42246.896370] task: ffffffc0f0434080 task.stack: ffffff8023ea0000
[42246.902465] pc : spin_bug+0x80/0xb8
[42246.906055] lr : spin_bug+0x64/0xb8
<...>
[42247.122346] Call trace:
[42247.124876]  spin_bug+0x80/0xb8
[42247.128110]  do_raw_spin_lock+0xe8/0x118
[42247.132144]  _raw_spin_lock+0x24/0x30
[42247.135916]  igrab+0x20/0x6c
[42247.138894]  f2fs_sync_inode_meta+0x58/0xc0
[42247.143199]  write_checkpoint+0x1c4/0xecc
[42247.147322]  f2fs_sync_fs+0x118/0x170
[42247.151096]  f2fs_do_sync_file+0x4f0/0x798
[42247.155311]  f2fs_sync_file+0x54/0x6c
[42247.159087]  vfs_fsync_range+0x90/0xac
[42247.162950]  vfs_fsync+0x2c/0x38
[42247.166278]  do_fsync+0x3c/0x78
[42247.169515]  SyS_fdatasync+0x20/0x30

Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
---
 fs/f2fs/inode.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 91ceee0..c57f636 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -702,11 +702,13 @@ void f2fs_evict_inode(struct inode *inode)
 	stat_dec_inline_dir(inode);
 	stat_dec_inline_inode(inode);
 
-	if (likely(!is_set_ckpt_flags(sbi, CP_ERROR_FLAG) &&
-				!is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
-		f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE));
-	else
+	if (unlikely(is_inode_flag_set(inode, FI_DIRTY_INODE))) {
 		f2fs_inode_synced(inode);
+		f2fs_msg(sbi->sb, KERN_WARNING,
+			 "inconsistent dirty inode:%u entry found during eviction\n",
+			 inode->i_ino);
+		f2fs_bug_on(sbi, 1);
+	}
 
 	/* ino == 0, if f2fs_new_inode() was failed t*/
 	if (inode->i_ino)
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-07  2:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19  6:02 [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list Ritesh Harjani
2018-11-19  6:02 ` [PATCH 2/2] f2fs: Set CP_ERROR_FLAG in case of inconsistent node page entries Ritesh Harjani
2018-11-19  7:15   ` Chao Yu
2018-11-19  6:39 ` [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list Chao Yu
     [not found]   ` <c5387fdb-6b20-ed3d-e9a5-ae55b5dbdd37@codeaurora.org>
2018-11-19 21:03     ` Jaegeuk Kim
2018-11-20 10:33       ` Ritesh Harjani
2018-11-21  3:30         ` Chao Yu
2018-11-23 11:07           ` Ritesh Harjani
2018-11-24  9:55             ` Chao Yu
2019-08-07  2:28         ` [f2fs-dev] " Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).