Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6531768ybi; Wed, 5 Jun 2019 02:23:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP3iQ3m5pe/uEGBrUtrcXQNf0jGlC48Ll0/b8lpgMGf0uJf72MroA/gzU0d8EUWaZ49gyv X-Received: by 2002:a17:902:ba88:: with SMTP id k8mr34987886pls.196.1559726627581; Wed, 05 Jun 2019 02:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559726627; cv=none; d=google.com; s=arc-20160816; b=v6X83nK96VNk1EfLGD5UKYOEApMcJWkUNbXoRFXvN2EjP3sKOxPIfiGhLETNIu1IOa SGxW6u/4P38aYMnSS1IwM7nu3tX0UJobX2wKiTgR6ZwBMVQHCA5qsgy9PuJzfanF7IoM 6loZqMPhGkBNDK8VuPELLcTwC01oFjstgn1iMzr7QZqWWLI2ywc2LjnEdFhlqOkiVgK1 +Mu67eZpEneksoqHRhqW4azE3L52c6Hbu1gyQcTl5HEl/YRef1a+8DPTYzvkFoaXRRun Jk3uYsyYXA2Ajqa/WFcmsowyPxGC+t+7fYIceoK5/Pnl3mvx/SethLLwze8f9lSuGwee intg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uDjBQkAVbNID/6IEXKOFNSbDIeMHgSat2+m5A0KFo3M=; b=ycW46PqlZy8lcWOakUENaVR5ulYcNr0f688AJKjp8LlAHtcecZs4vPvKVSDjs6GaWJ B3M5F2LW/apNlyAtu0MYHBm8JQgwRX6S+bZTkM9EATiNuDLX0RUHhn0b5CWZXSJlkM9D BrxheNT8+dX4gvyl1BLeuFXAeLk42KJ3oYM8/nbJfz/3PUlvibnb2kX1nYRfCrcLK65l w59u+nA1PVYbQFf43J9Q9mG4fJw7JpVcmdStkY9PhAQoTwf2RHE2p+mRLfw/hOlIr/nr 2AvZ1hvnFRZwTEUA4OEOaGf4GRp+MHjkcVY3aYrUvREiQH0sPi6FYAM8wst0Loq3n2Ks 8X0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RHXwbjIi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si24644329pgh.143.2019.06.05.02.23.30; Wed, 05 Jun 2019 02:23:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RHXwbjIi; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfFEJV7 (ORCPT + 99 others); Wed, 5 Jun 2019 05:21:59 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:38830 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbfFEJV6 (ORCPT ); Wed, 5 Jun 2019 05:21:58 -0400 Received: by mail-io1-f66.google.com with SMTP id x24so19666125ion.5; Wed, 05 Jun 2019 02:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=uDjBQkAVbNID/6IEXKOFNSbDIeMHgSat2+m5A0KFo3M=; b=RHXwbjIiFnQT8YPT/t/8R6S8Isf5kbM4MgtKHCD0NGKh7HLa8sPQgTVk8v1qNWpoiF Rhq+9Yl7c1ZJD05i62ck5l4Y0RpNoDGDNJYAqbn8ugHSy9iP9/N6BRYkxY+32oN4YYJp 5EtMvW0TcWwmXCiGyXTHksDh/tmoIJfl3gbaU11q8+EgrCPCc9y75svoD2y70J6e8RB7 6v1AuZlQcyqU5Kf6d+RnJEP6LR7dtuKsB8Mm048NlWPsa/8jKOyVelcKUBFB5Ab/vhQ5 ugL6ThWymA5ec//v8iLYg/N2yHP2fxhwYmJgqYZZHweVhkd7DTPZPR+OBDj7+icJ5t4/ W2Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=uDjBQkAVbNID/6IEXKOFNSbDIeMHgSat2+m5A0KFo3M=; b=g+lPA+j5B1lomooTS0QnRIXZZDZulY8jRCbYkPN55reubgVPsluOQAg6vKjqVt9vbx gi1yqG1KPICeXab+A5BOofc098zIW5Smg12lJUduB/Jz4ho7nPRC1S1JAdQw7blhp04u wQ5SYdy0h6c8LZKCxtGcGf7nWNuO+QZnCfGud9qYVcn8uDVy+83i31BEqg4R9qTHbmHI qbRKi0Ws3GgYgDUqYBAUV5s13bVG+lmB1YAhRuELbqFbLgUHHe/0TD5rDzOy+AikfXAo B3YwBxby7KT9VhlAdsGk/m+r0UgxTS5Pcwd2wdlwCQ5A3AiAhGl89GaKlHQIubFym2qE pQeQ== X-Gm-Message-State: APjAAAU2F6wGWxk8hQABzfIvX5huqvwh9v6tHjXYU/ypjmBpIhaL9ik/ d44hyemTlpqeY4/uTvcY20PK58QgCroKVF6mCw== X-Received: by 2002:a6b:7d09:: with SMTP id c9mr24679346ioq.245.1559726517832; Wed, 05 Jun 2019 02:21:57 -0700 (PDT) MIME-Version: 1.0 References: <6823d3ab-5f93-da74-0dbc-19bdb7be6907@suse.de> <3399cad5-4387-dd23-77f1-a70e551fb531@suse.de> <78880cf8-07c6-e00d-0084-ce9c211eeec6@suse.de> In-Reply-To: <78880cf8-07c6-e00d-0084-ce9c211eeec6@suse.de> From: =?UTF-8?Q?Bj=C3=B8rn_Forsman?= Date: Wed, 5 Jun 2019 11:21:46 +0200 Message-ID: Subject: Re: bcache: oops when writing to writeback_percent without a cache device To: Coly Li Cc: Kent Overstreet , linux-bcache@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Jun 2019 at 06:41, Coly Li wrote: > > On 2019/6/5 1:24 =E4=B8=8A=E5=8D=88, Bj=C3=B8rn Forsman wrote: > > On Tue, 4 Jun 2019 at 17:41, Coly Li wrote: > >> > >> On 2019/6/4 10:59 =E4=B8=8B=E5=8D=88, Coly Li wrote: > >>> On 2019/6/4 7:00 =E4=B8=8B=E5=8D=88, Bj=C3=B8rn 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 figur= es > >>>> 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 sens= e > >>> to update the writeback rate in period by the changing of writeback_p= ercent. > >>> > >>> 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 ? Yes, you can add my Reviewed-By: tag. --=20 Bj=C3=B8rn Forsman