Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2239535imm; Thu, 18 Oct 2018 11:12:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV63XKFYH6IpdRQ5YXwHicC4yRAf5G14iI5Gqs4Avoj7OSD52w80fng9+buoXNMAsNohp3buh X-Received: by 2002:a63:330e:: with SMTP id z14-v6mr2571580pgz.220.1539886376415; Thu, 18 Oct 2018 11:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539886376; cv=none; d=google.com; s=arc-20160816; b=s7735m1iih8QwiBG2dC2vLJjLYPgx7Zv/1ck4OEXt0W2urvLe5Dt1lCyq0bv7NFEPM yq/d03gQ6uJZH72G/vv2x4xQcG30Y5DQeUg2005U3vXHP/k18sfwC1sGM80AalDFzRgy 9F39F3FhFpjWDyz0WRo4dQ9XsCoYQJ2tsYG9lgPr5zYTtmiG0C2eJojE3IXI+jvFb5rd i+Qc7l6MpeF0MGEYIL05t5fmJpdV7dGGUIfncIeiwDJQnJeVBm9Zy8nnPIBwotwmEWOT IE3pq2KLQK5glnoASxwkezSkE2co6zREjB2Zj+C5oozr/MAsSSamfF5g0tfd7v/8Etix mfuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=kKlDE4g/KLD4YIpmlhD27m5tibyOGMjxmAw4ddLA/9o=; b=ZSb+z0EpZa5xT0AJBRLxnJMgEctTW24z1zwRpASQa+EFQgl34dB3lZsdzRExKzJlUT S6RPywVMz951LdK3Wa265+KhoAandol4+mqlBn9GVjYI603rMjgO8ilqHfViWav4izfP 7wlLS/2cHJOzFT3R0fXZNQQi7tD8UuLbOSvzeOLuwN8s1U0dq+p/6OWPN1PYC5WItlUF HncmICccULtcKwWCRHplUwPbHpYB3SHqZOHgN+dSN4jf63E/YpuqNPrYVOVYQkgO3ah1 xso9jqTeiK8kswTGlJIi/3UEpP795eCty0vaHZlXYNy6HoTT8PB21WNrSUjEwePnY/bS adcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dyVQu218; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 202-v6si20380896pgb.63.2018.10.18.11.12.40; Thu, 18 Oct 2018 11:12:56 -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=@chromium.org header.s=google header.b=dyVQu218; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729617AbeJSCDu (ORCPT + 99 others); Thu, 18 Oct 2018 22:03:50 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:43044 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbeJSCDt (ORCPT ); Thu, 18 Oct 2018 22:03:49 -0400 Received: by mail-yb1-f193.google.com with SMTP id w80-v6so12205017ybe.10 for ; Thu, 18 Oct 2018 11:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kKlDE4g/KLD4YIpmlhD27m5tibyOGMjxmAw4ddLA/9o=; b=dyVQu218HHt1p2w/ALkeYcPlheX50n2sRH4dtJ6Mdzf39PByRYTG06TeX6dEq7JDGY uiYFWxF0qALSTzt4THRrB88F1xRDqW0NhSwMZlUyrWcgNkDsKhQLnW/qVZ1kqvWshPJM HBj4vpwDvCXPLUKsJerSsZZJ2ogPkauJ3fwbI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kKlDE4g/KLD4YIpmlhD27m5tibyOGMjxmAw4ddLA/9o=; b=cITacsy1BDIMbh00Ys5HIt9qAC9FI3xPC906iRHhPVp8+ju3QKCzrA6JlRADHlnMj5 ySNTjQtaGQ417v6gXNaKz0XVUE9ptaF633n29qFjvy9JqwbWuF4xK2S68laN88OSdw9b hiRhNLGaXkvSOzP9ODrvMEV4VTHVi7USWkMLGYDeFu8FKdL9iIoKaLeXMzz320vEHDef wnD8+u7X/jYXJew3sRMe++u16CARn8/V8WalpGfOXi/vl23jHINzf8nATEL5NM/ifQMg HWMMpferFpbOVAqXqZaYOampkEvDqRwvmhFSwOyVVXShqw9P/inyIszo3MrATqMwsgv2 mYbg== X-Gm-Message-State: ABuFfojJ2aHzirm+EZgKL6Dugwt+O93k87iUXvFGAoWNRMd3JjPMAIBF y4wpmmr8viAZ1DbKdJ1lTUQBX8kvWdo= X-Received: by 2002:a25:2c8:: with SMTP id 191-v6mr2595786ybc.302.1539885702347; Thu, 18 Oct 2018 11:01:42 -0700 (PDT) Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id i62-v6sm5314197ywb.32.2018.10.18.11.01.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 11:01:40 -0700 (PDT) Received: by mail-yw1-f47.google.com with SMTP id d126-v6so12168394ywa.5 for ; Thu, 18 Oct 2018 11:01:39 -0700 (PDT) X-Received: by 2002:a81:98cb:: with SMTP id p194-v6mr19826401ywg.353.1539885699421; Thu, 18 Oct 2018 11:01:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:d116:0:0:0:0:0 with HTTP; Thu, 18 Oct 2018 11:01:38 -0700 (PDT) In-Reply-To: <10d9618bf794d6e07b537455344b30238d5f4e80.camel@perches.com> References: <20181017214124.GA8239@beast> <10d9618bf794d6e07b537455344b30238d5f4e80.camel@perches.com> From: Kees Cook Date: Thu, 18 Oct 2018 11:01:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] pstore: Refactor compression initialization To: Joe Perches Cc: Joel Fernandes , Sai Prakash Ranjan , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 10:14 AM, Joe Perches wrote: > On Wed, 2018-10-17 at 14:41 -0700, Kees Cook wrote: >> With compression initialization now separated from pstore_register(), >> there is no longer a good reason to do compression method selection >> during fs init. Instead, merge everything together into the late init. >> Additionally cleans up the reporting to be more clear. > [] >> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > [] >> @@ -274,36 +274,56 @@ static int pstore_decompress(void *in, void *out, > [] >> - big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL); >> - if (!big_oops_buf) { >> - pr_err("allocate compression buffer error!\n"); >> + buf = kmalloc(size, GFP_KERNEL); >> + if (!buf) { >> + pr_err("Failed %d byte compression buffer allocation for: %s\n", >> + size, zbackend->name); > > Given that there is a generic OOM message emitted on > kmalloc failures, rather than expanding the unnecessary > alloc failure message, how about just deleting it instead? I prefer including more context (i.e. the desired compression method). -Kees -- Kees Cook Pixel Security