Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6252475ybi; Tue, 4 Jun 2019 21:42:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4YinG/aAGCsQHHL2W9StlRJ7HzTOz37ulDRAh4Pf/15P/8lKOhYSrq7fSLx6HLjdzvFMQ X-Received: by 2002:a63:e54d:: with SMTP id z13mr1720987pgj.132.1559709754376; Tue, 04 Jun 2019 21:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559709754; cv=none; d=google.com; s=arc-20160816; b=F8P88AsP00dugpysPtu2TUa97yN4DM+hNhuv+Er5DCKWHvLs2jZvPwsmowg1ehXg9L WCeXKms3DqJAqnP5VP5BZhAwlTcuoDWXtQOGIkh8yZ9vTH9TjYUMDJpqr8kIfTG6I8Pd hMGEh/IAuJUq6BMq9+nqPKxJDdto81L0zcTULI6L3HGTWx7QAFbc2fR1bGOI23Sv5mJd DFcpKWght11PQr/K/kRbATPoTEe6wGL+z/RHn4/tb82zMD3iWOS9gghKXCCVlCYSnetd otgP+z31rM1VofdQUmujkvP65d7JJjxW291eM4Ei/lzVW+z0jHYq/Wf7swk0+wnuCjuC 0vPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:openpgp:from:references:cc:to:subject; bh=uIsFW+2QIMUjF3VU2q7/X3Yqar5bQdE377M/MMrP1RQ=; b=S4Pj4gW81DTYKTVctEqnkQ4ktMJAZKNlg2K/6gGdsvmWPbhFwVQpMmA1+qZ9CzNBld fYkz4TgVzw8rFX4tkvZXF2v0xNxPotS8qTiBfjeD2mJORxX2agnfIBIihLlczHaST6Dv l6YjpVOtZGEbx/DVCRdee7qCeyogVlGatAOQ+oY+btmhlBZlsc/3MCX0Dp/NC9Ecd/xC WBmFkrnme3fCW5H4DGc3U4ntG0f+1izMZ4gerO83xMGjDUEXaMXfMFBjXAZNNDpJNELt sKJ+4rPPVV8uvUymmNLt2mBkM5nfw4BgMaDvh8tvvjHySUaLn6mlUuvLQ7ILtpKELaJ+ VnTQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo10si23694593pjb.59.2019.06.04.21.42.16; Tue, 04 Jun 2019 21:42:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbfFEElI (ORCPT + 99 others); Wed, 5 Jun 2019 00:41:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:45064 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725268AbfFEElI (ORCPT ); Wed, 5 Jun 2019 00:41:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4DBC8AEEC; Wed, 5 Jun 2019 04:41:07 +0000 (UTC) Subject: Re: bcache: oops when writing to writeback_percent without a cache device To: =?UTF-8?Q?Bj=c3=b8rn_Forsman?= Cc: Kent Overstreet , linux-bcache@vger.kernel.org, LKML References: <6823d3ab-5f93-da74-0dbc-19bdb7be6907@suse.de> <3399cad5-4387-dd23-77f1-a70e551fb531@suse.de> From: Coly Li Openpgp: preference=signencrypt Organization: SUSE Labs Message-ID: <78880cf8-07c6-e00d-0084-ce9c211eeec6@suse.de> Date: Wed, 5 Jun 2019 12:41:01 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/6/5 1:24 上午, Bjørn Forsman wrote: > On Tue, 4 Jun 2019 at 17:41, Coly Li wrote: >> >> On 2019/6/4 10:59 下午, Coly Li wrote: >>> On 2019/6/4 7:00 下午, Bjørn Forsman wrote: >>>> Hi all, >>>> >>>> I get a kernel oops from bcache when writing to >>>> /sys/block/bcache0/bcache/writeback_percent and there is no attached >>>> cache device. See the oops itself below my signature. >>>> >>>> This is on Linux 4.19.46. I looked in git and see many commits to >>>> bcache lately, but none seem to address this particular issue. >>>> >>>> Background: I'm writing to .../writeback_percent with >>>> systemd-tmpfiles. I'd rather not replace it with a script that figures >>>> out whether or not the kernel will oops if writing to the sysfs file >>>> -- the kernel should not oops in the first place. >>> >>> Hi Bjorn, >>> >>> Thank you for the reporting. I believe this is a case we missed in >>> testings. When a bcache device is not attached, it does not make sense >>> to update the writeback rate in period by the changing of writeback_percent. >>> >>> I will post a patch for your testing soon. >> >> Hi Bjorn, >> >> Could you please to try this patch ? Hope it may help a bit. > > Hi Coly, > > Thanks for the quick patch! I tested it on linux 5.2-rc2 and it indeed > fixes the problem. > > There is one typo in the patch/commit message: s/writebac/writeback/ > Hi Bjorn, Thanks for the patch review. Do you mind if I add Reviewed-By: tag with your name and email address ? -- Coly Li