mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: <jaegeuk@kernel.org>
Cc: <linux-f2fs-devel@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>, <chao@kernel.org>,
	Chao Yu <yuchao0@huawei.com>
Subject: [PATCH 1/4] f2fs: compress: fix panic in mkwrite
Date: Mon, 6 Jan 2020 16:01:41 +0800	[thread overview]
Message-ID: <20200106080144.52363-1-yuchao0@huawei.com> (raw)

[ 1237.458208] invalid opcode: 0000 [#1] SMP PTI
[ 1237.458228] CPU: 9 PID: 6291 Comm: fsstress Tainted: G           OE     5.5.0-rc1 #36
[ 1237.458255] Hardware name: Xen HVM domU, BIOS 4.1.2_115-908.790. 06/05/2017
[ 1237.458299] RIP: 0010:f2fs_vm_page_mkwrite+0x1c6/0x630 [f2fs]
[ 1237.458321] Code: d6 fe ff ff 49 8b 75 20 48 89 df e8 24 0a 05 00 85 c0 41 89 c7 78 8e 0f 84 bd fe ff ff 45 31 f6 41 83 ff 02 0f 85 c3 fe ff ff <0f> 0b 45 84 f6 0f 84 e4 00 00 00 ba 01 00 00 00 be 05 00 00 00 48
[ 1237.458374] RSP: 0000:ffffaecdc0c1bd38 EFLAGS: 00010246
[ 1237.458395] RAX: 0000000000000002 RBX: ffff9241c5b5d8c0 RCX: 0000000000000000
[ 1237.458418] RDX: ffffeeb715d42407 RSI: ffff9242d8085168 RDI: 0000000000000000
[ 1237.458441] RBP: ffff9243f1c67000 R08: 0000000000017677 R09: 0000000000000004
[ 1237.458463] R10: 0000000000000000 R11: ffff9242d8085000 R12: ffffaecdc0c1bdf8
[ 1237.458488] R13: ffffeeb715d037c0 R14: 0000000000000000 R15: 0000000000000002
[ 1237.458512] FS:  00007f71f28ce700(0000) GS:ffff92443d840000(0000) knlGS:0000000000000000
[ 1237.458540] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1237.458561] CR2: 00007f71f28c9000 CR3: 00000007e0ba2003 CR4: 00000000001606e0
[ 1237.458586] Call Trace:
[ 1237.458611]  do_page_mkwrite+0x5a/0xc0
[ 1237.458630]  __handle_mm_fault+0xb81/0x12a0
[ 1237.458648]  ? do_mmap+0x4bd/0x640
[ 1237.458665]  handle_mm_fault+0xe3/0x1d0
[ 1237.458686]  __do_page_fault+0x288/0x500
[ 1237.458704]  do_page_fault+0x30/0x120
[ 1237.458725]  page_fault+0x3e/0x50

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/file.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9aeadf14413c..f18d1262b274 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -72,7 +72,10 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
 			err = ret;
 			goto err;
 		} else if (ret) {
-			f2fs_bug_on(sbi, ret == CLUSTER_HAS_SPACE);
+			if (ret == CLUSTER_HAS_SPACE) {
+				err = -EAGAIN;
+				goto err;
+			}
 			need_alloc = false;
 		}
 	}
-- 
2.18.0.rc1


             reply	other threads:[~2020-01-06  8:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06  8:01 Chao Yu [this message]
2020-01-06  8:01 ` [PATCH 2/4] f2fs: compress: revert error path fix Chao Yu
2020-01-06 19:26   ` Jaegeuk Kim
2020-01-08  9:33     ` Chao Yu
2020-01-06  8:01 ` [PATCH 3/4] f2fs: compress: fix error path in prepare_compress_overwrite() Chao Yu
2020-01-06 19:08   ` Jaegeuk Kim
2020-01-07  1:35     ` Chao Yu
2020-01-08 20:49       ` Jaegeuk Kim
2020-01-06  8:01 ` [PATCH 4/4] f2fs: compress: release compress context in caller of f2fs_read_multi_pages() Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200106080144.52363-1-yuchao0@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®