Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1309101imu; Wed, 9 Jan 2019 15:50:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN4SWe7tOM2L5NlriSu7PQ3jZg2ywP7gkzuS2wzgSxekrcBrPRm1Yf2HRGtl+NBfOSi3hwlO X-Received: by 2002:a65:65c9:: with SMTP id y9mr7473795pgv.438.1547077842960; Wed, 09 Jan 2019 15:50:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547077842; cv=none; d=google.com; s=arc-20160816; b=jbzJWycbwQfyWjO7haODYVF90qnnRvr/l1ckfhMKJoA75ffv6326z3dLCbpf6c7QuH 5vxqx1dTBJL3k5hOuOIROYPuBs6olEg6ElFctbreap53BkkPaRhlgtwPSpFpkR+weQb9 5HPb1hBOujCY3jI/ZEtnkAk/wFMNszURAOYBgNcmN2XU55dzerFHtCVKZATHdts6tvbi JFa7Vl0IrRhP1WIxemwI1L3KY/JfrRcdGJRugD8ZUU0ccyWun9NqZX4pfTU7zXWWMzmR bLpq8vbLuap+TL9xVnxHHGr/eeUc7vh9JI9MRC/OQC4Nv92ZzsUV82mJy6pSq2jXLAL0 wYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eOTfFhWeMywsSR5GJ4usHqLsy2j88yLrJkCAndBWQ8w=; b=TSqe8qdYLiW/Al+yAJ0nWRwXJWa27Sl1nhn2OVcPWIJNxpXtJzw8i+96ndwjrN7WVG zr/b8oKSbx/HXD1yMJspYXkWLbTL+OSgt7NY+D70Dv1Za3QXpIzN81NbMSigvRRQu1Q3 hOTyBPa8wg9+WY7+jXxb+nPEAQ6aYXkja+scU5y6sT8dhoHlJ2nvNS4z1wS67DFbOC9f P1qCm2qcTlhmWFzme+WyCe/hBo6HubEGujU+AEObiyCq/mcRjUPOhbAyadNUVIwSJPcl 1F8KEs8SnsNIlWIcX4oWgEH1aqWTBfOU+u/mTt6rDW7yrOHbPuQdTCwB9iJpGm1L1WEF QlRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EesMoOAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si72755524pfi.286.2019.01.09.15.50.24; Wed, 09 Jan 2019 15:50:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EesMoOAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfAIXSw (ORCPT + 99 others); Wed, 9 Jan 2019 18:18:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:37906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbfAIXSv (ORCPT ); Wed, 9 Jan 2019 18:18:51 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8E72206BB; Wed, 9 Jan 2019 23:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547075930; bh=0/l5QemOuQnZwvQpHxJkbOEjVvQySnIhzzxeDLu9diY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EesMoOAwMqL+ohc5VSS7mm21DHdvfDBheSZqUZKzb0OHQtt0JBb9Z1j/wZDTavj5U mO8KgKZMb9PG66T+fetuGy4ESl//Gicz7d1eLV44RqQcX1Ovh6zahymzVJN7JrUGBG eIxq0yj9y04mMgg0qRZKg1xwXjd5JZ2SC5NPt9AY= Date: Wed, 9 Jan 2019 18:18:49 -0500 From: Sasha Levin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Theodore Tso , stable@kernel.org Subject: Re: [PATCH 4.20 079/145] ext4: check for shutdown and r/o file system in ext4_write_inode() Message-ID: <20190109231849.GK166797@sasha-vm> References: <20190107104437.308206189@linuxfoundation.org> <20190107104447.599996662@linuxfoundation.org> <20190107215606.GH166797@sasha-vm> <20190109164455.GA3486@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190109164455.GA3486@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 05:44:55PM +0100, Greg Kroah-Hartman wrote: >On Mon, Jan 07, 2019 at 04:56:06PM -0500, Sasha Levin wrote: >> On Mon, Jan 07, 2019 at 01:31:56PM +0100, Greg Kroah-Hartman wrote: >> > 4.20-stable review patch. If anyone has any objections, please let me know. >> > >> > ------------------ >> > >> > From: Theodore Ts'o >> > >> > commit 18f2c4fcebf2582f96cbd5f2238f4f354a0e4847 upstream. >> > >> > If the file system has been shut down or is read-only, then >> > ext4_write_inode() needs to bail out early. >> > >> > Also use jbd2_complete_transaction() instead of ext4_force_commit() so >> > we only force a commit if it is needed. >> > >> > Signed-off-by: Theodore Ts'o >> > Cc: stable@kernel.org >> > Signed-off-by: Greg Kroah-Hartman >> > >> > --- >> > fs/ext4/inode.c | 9 +++++++-- >> > 1 file changed, 7 insertions(+), 2 deletions(-) >> > >> > --- a/fs/ext4/inode.c >> > +++ b/fs/ext4/inode.c >> > @@ -5400,9 +5400,13 @@ int ext4_write_inode(struct inode *inode >> > { >> > int err; >> > >> > - if (WARN_ON_ONCE(current->flags & PF_MEMALLOC)) >> > + if (WARN_ON_ONCE(current->flags & PF_MEMALLOC) || >> > + sb_rdonly(inode->i_sb)) >> > return 0; >> > >> > + if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) >> > + return -EIO; >> > + >> > if (EXT4_SB(inode->i_sb)->s_journal) { >> > if (ext4_journal_current_handle()) { >> > jbd_debug(1, "called recursively, non-PF_MEMALLOC!\n"); >> > @@ -5418,7 +5422,8 @@ int ext4_write_inode(struct inode *inode >> > if (wbc->sync_mode != WB_SYNC_ALL || wbc->for_sync) >> > return 0; >> > >> > - err = ext4_force_commit(inode->i_sb); >> > + err = jbd2_complete_transaction(EXT4_SB(inode->i_sb)->s_journal, >> > + EXT4_I(inode)->i_sync_tid); >> > } else { >> > struct ext4_iloc iloc; >> >> Hi Ted, >> >> I'm not sure if this patch is the culprit or no, but testing with >> xfstests on 4.20.1-rc1 started failing generic/390 with: >> >> [ 3405.656893] run fstests generic/390 at 2019-01-07 20:26:55 >> [ 3406.524380] EXT4-fs (nvme0n1p2): mounted filesystem without journal. Opts: acl,user_xattr >> [ 3406.731410] WARNING: CPU: 0 PID: 93128 at fs/ext4/ext4_jbd2.c:53 ext4_journal_check_start+0x121/0x190 >> [ 3406.731418] CPU: 0 PID: 93128 Comm: fsstress Tainted: G B W 4.20.1-rc1+ #1 >> [ 3406.731420] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090007 05/18/2018 >> [ 3406.731425] RIP: 0010:ext4_journal_check_start+0x121/0x190 >> [ 3406.731430] Code: 4d 85 e4 74 1e 4c 89 e2 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 4f 41 f6 04 24 02 75 0b 31 c0 5b 41 5c 5d c3 <0f> 0b eb ab 48 c7 c1 60 b4 f9 a4 ba 3d 00 00 00 48 c7 c6 a0 b8 f9 >> [ 3406.731432] RSP: 0018:ffff888f30317648 EFLAGS: 00010246 >> [ 3406.731437] RAX: 0000000000000000 RBX: ffff888ee6ce12c8 RCX: 000000000000000c >> [ 3406.731440] RDX: 1ffff111dcd9c2a0 RSI: 0000000000000b33 RDI: ffff888ee6ce1500 >> [ 3406.731442] RBP: ffff888f30317658 R08: 0000000000000000 R09: ffffed11db5f01a7 >> [ 3406.731444] R10: 0000000000000001 R11: ffffed11db5f01a6 R12: ffff888ee6ce2ee8 >> [ 3406.731447] R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888f303178e0 >> [ 3406.731450] FS: 00007fc015d5cb80(0000) GS:ffff888f6b800000(0000) knlGS:0000000000000000 >> [ 3406.731452] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >> [ 3406.731455] CR2: 0000557f34651000 CR3: 0000000f2c722000 CR4: 00000000003406f0 >> [ 3406.731459] Call Trace: >> [ 3406.731465] __ext4_journal_start_sb+0x95/0x380 >> [ 3406.731479] ext4_writepages+0x10e1/0x3170 >> [ 3406.731567] do_writepages+0xc7/0x120 >> [ 3406.731577] __filemap_fdatawrite_range+0x313/0x470 >> [ 3406.731594] file_write_and_wait_range+0x7c/0xd0 >> [ 3406.731598] __generic_file_fsync+0x6c/0x180 >> [ 3406.731601] ext4_sync_file+0x60b/0xf90 >> [ 3406.731626] vfs_fsync_range+0xf5/0x210 >> [ 3406.731630] do_fsync+0x3d/0x70 >> [ 3406.731634] __x64_sys_fdatasync+0x36/0x50 >> [ 3406.731638] do_syscall_64+0x153/0x460 >> [ 3406.731666] entry_SYSCALL_64_after_hwframe+0x44/0xa9 >> [ 3406.731669] RIP: 0033:0x7fc0152412c4 >> [ 3406.731673] Code: 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8d 05 41 96 2d 00 8b 00 85 c0 75 13 b8 4b 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3c f3 c3 66 90 53 89 fb 48 83 ec 10 e8 04 94 >> [ 3406.731675] RSP: 002b:00007ffc445f72f8 EFLAGS: 00000246 ORIG_RAX: 000000000000004b >> [ 3406.731679] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc0152412c4 >> [ 3406.731681] RDX: 00007ffc445f7250 RSI: 00007ffc445f7250 RDI: 0000000000000003 >> [ 3406.731683] RBP: 0000000000000034 R08: 00007fc015515c40 R09: 0000000000000000 >> [ 3406.731685] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000001f4 >> [ 3406.731687] R13: 0000000051eb851f R14: 00007ffc445f73f6 R15: 0000557f33ad1930 >> [ 3406.731690] ---[ end trace 698eba2a0467d312 ]--- >> >> I'm also slightly confused here because this test is for ext4 without >> journal (see even "EXT4-fs (nvme0n1p2): mounted filesystem without >> journal") but for some reason it seems that this still goes to the >> journal? >> > >Does this also fail on 4.19? The same patch is here and in 4.14 as >well. I'm seeing a failure with this config only on 4.20. -- Thanks, Sasha