Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp619409pxx; Mon, 26 Oct 2020 17:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyclDsWiTGQXqGHCVGPRSow5CVBZjXJT7zSV+xix1OKGzXY2scyGYOg72CilnKIsNZGwNxL X-Received: by 2002:a17:906:cc4d:: with SMTP id mm13mr18200848ejb.330.1603757220749; Mon, 26 Oct 2020 17:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603757220; cv=none; d=google.com; s=arc-20160816; b=lg+BqA0avOFcGnqd18PP5XWlcPENeCIuegvuOu2ykJ4BwpINshyiO6II9ntvxIdBkS VowGruBhU7agGAMg3B2F3kivF1V5/A//+F+vKJGQBeGRILjPcDub9vDHc+L2r52rcGe2 eMLpUq8nsBHQsZQ8rAGwl03d0+SbgjOd4sZjI+ymt6X26EJv7h2RZslS/jPqwP4Bn/ZY A5qy4IGDeNAJzr63RPh7V3/9U1MvueUw1JUOoaNvgS2j4lGWuYoF5I8XKOk+J5s9h14Z /EmW46XSvILK12eoEti9KyQRL4ZgG4FH+pJOIUHhkBkSuKQ2ZClZrxQa0W93c5ntpa8K 5LhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M0VSZbhlydSBKzOaomukoTTp30g7sC2N3nt7wUIINqk=; b=FJArwjh0Jtm46aLs2kf352mXlgbe0pnX5I8K8j8TAP16HEQMeCT+p1motAUvrpF9nn d7tsBLnvLQafI6XRXy37L7A74an3Sjn6GkiTKVKdjWKNz1DULdY1/CiRDIrJeCNR3Ms2 pyp9EAtUyx9UEx9al4uZgHVhQG3CAnJZjVhZJb+np4tCx3U0Mazj8onboT8DM2HCw4cp slLpdbdSSt26dcp60bnKTbvEApV0dXZtrMw6jMSBLWLZafqKHv2RAIUWSD3z9pOcHdbD hU4MXwSZL8dN3fNf1YwF5F4QFy4qHbh5sRS66K9szsF9FxF4UlqBwHctfyz9yYhtEaKD nWew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N1JD5itU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id t14si7977199ejd.338.2020.10.26.17.06.38; Mon, 26 Oct 2020 17:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N1JD5itU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2392107AbgJZWH0 (ORCPT + 99 others); Mon, 26 Oct 2020 18:07:26 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34760 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391702AbgJZWH0 (ORCPT ); Mon, 26 Oct 2020 18:07:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id t14so6856069pgg.1; Mon, 26 Oct 2020 15:07:25 -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; bh=M0VSZbhlydSBKzOaomukoTTp30g7sC2N3nt7wUIINqk=; b=N1JD5itU3YYw/BGCFmuNc7BXm2NtCL3p+Di0AcCMValw6fquKQx9bXQZ2RW+Wu2Ia6 lIXA6lSXUCKY4DxcYQTMhgz1FukjQndV/+T71p6PNQZrb8CAX+Rt7Gh3yNsEAjqWXKh+ EoRDsd4bNU2VidntDRSwEKLVDNNq1Yw+a7n+mCA9b4+P8IF5HY6CiV4UnGCozu1tmUJF /mE7BMZCrTZahcRRr8+rZeeP255OzF2vvDCS7S/4xXnH8N0tgcjNMw4VXJccizxbKxu0 xVq3TEJM2ASXZNjl2S4afbceoWRNOp2UCoHpaqQc/CEQwP2VfAPEZsFwt91eqVc83Ckw FdaQ== 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; bh=M0VSZbhlydSBKzOaomukoTTp30g7sC2N3nt7wUIINqk=; b=diAIaZYa67o439ojiT5GKyeOQ75NENEL7Xqu19g02CeJpi91EUnBjQ812CkBl68h6k H6DJgj+zZ83uUyv3YRgtfA86e70stZ4oLhoenOpOTaHSvvRZu0qq1x4f1Vkv2GeF/JwL obGPL9lBZihEelngKlJbbM0WKdefqdAMCyXdREhLxKcuHwGrW749Yr1Zc/r/cfLGsCYM 0YaoUlOs7wWK1sJJPUpj0nkcnY+UlNvnRgwNRQdr2D/oMBt2lL749bSX16RJcS/45nG9 8aUFcm4kAEweO51T2mNhDN6vjvZ8WA4KjmWzhDNwqWeV1cXyDP4MNqGHBPJeWN/Yd0JJ APBA== X-Gm-Message-State: AOAM531tY4JKn2P9HxqKO9z5IlhdtrQblLXFuiwFah/eF3AvSHteYcWc 07+sIQAw5F0Qt3QNMYr32jsbuiXe4vZFmOobosE= X-Received: by 2002:a63:d54e:: with SMTP id v14mr18099847pgi.203.1603750045311; Mon, 26 Oct 2020 15:07:25 -0700 (PDT) MIME-Version: 1.0 References: <20201026155730.542020-1-tasleson@redhat.com> In-Reply-To: <20201026155730.542020-1-tasleson@redhat.com> From: Andy Shevchenko Date: Tue, 27 Oct 2020 00:07:09 +0200 Message-ID: Subject: Re: [PATCH] buffer_io_error: Use dev_err_ratelimited To: Tony Asleson Cc: Alexander Viro , Linux FS Devel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 10:59 PM Tony Asleson wrote: > > Replace printk_ratelimited with dev_err_ratelimited which > adds dev_printk meta data. This is used by journald to > add disk ID information to the journal entry. > This re-worked change is from a different patch series > and utilizes the following suggestions. > > - Reduce indentation level (Andy Shevchenko) > - Remove unneeded () for conditional operator (Sergei Shtylyov) This should go as a changelog after the cutter '---' line... > Signed-off-by: Tony Asleson > --- ...somewhere here. ... > - if (!test_bit(BH_Quiet, &bh->b_state)) > - printk_ratelimited(KERN_ERR > - "Buffer I/O error on dev %pg, logical block %llu%s\n", > - bh->b_bdev, (unsigned long long)bh->b_blocknr, msg); > + struct device *gendev; > + > + if (test_bit(BH_Quiet, &bh->b_state)) > + return; > + > + gendev = bh->b_bdev->bd_disk ? > + disk_to_dev(bh->b_bdev->bd_disk) : NULL; I'm not sure it's a good idea to print '(null)'. Perhaps if (bh->b_bdev->bd_disk) dev_err_ratelimit(disk_to_dev(bh->b_bdev->bd_disk), ...); else pr_err_ratelimit(...); ? > + dev_err_ratelimited(gendev, > + "Buffer I/O error, logical block %llu%s\n", > + (unsigned long long)bh->b_blocknr, msg); It's a u64 always (via sector_t), do we really need a casting? > } -- With Best Regards, Andy Shevchenko