Received: by 10.223.176.46 with SMTP id f43csp1282615wra; Fri, 19 Jan 2018 09:17:30 -0800 (PST) X-Google-Smtp-Source: AH8x225K+L/4uTyTV59kV2BNQpr4EghMtqHdacDWnQt5KY7jKQQk9qXEMLyTRWrqvVMMfvBIbW3X X-Received: by 10.101.82.134 with SMTP id y6mr1794927pgp.101.1516382250108; Fri, 19 Jan 2018 09:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516382250; cv=none; d=google.com; s=arc-20160816; b=0CjcM0lSwWAFWOl9FsHBaLr3yFaiyrI2gd5EyfycYFTEr3YJpx87RFxSBIHbgbZivP R3mkMYOAPV8o+gWHlvTjSQZ6LFrkbhqi6XPWTuxwNiLkHwWcPb0waYBqZhMvgi9Q1UQw eMjtCuFzYkhltQM0F6HOoQE2oRSYfdvg18SWzRPQRD1vYIP5waW1tvoJ0XG7fkTxgg5l yPfb/edf0COfRKrxPCIHbb1XHFDiWwZLEY/LNbWRqqCAGTi5ohtino5QUu4K6+UDJDER dgPQZl5Qg/aeC+VBb5UZsPajgEtuMCxt4QeoBi2ar/r1MWOsLFOQQ57OIXZFPzWNY2cq bhZg== 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:arc-authentication-results; bh=e+42sYQc7Y+YIpCJT3NnNLxrhssWIQ9gO582Evushd8=; b=zqS+njDPNWvie/3cA9BUT06Vmt6qzkZxO+iY5uwCu81GaV4UlxKCfzfpnXfuTYto4u 66mwFS5XuviV/ZzsNVVJC5LkXZFAXvfdEYC284ydXa+7/MZm9KMukICO+K/iNIseYKHQ aBlIxq1kO3JVgt7321x4dS7Ssn03OeQe7q9lKHWnnXrSX6Bp/Cy4+gtKkbufQUwj2Crh rYe4QgNY/ls7xD6HxJuZIw5nbLgpExdZi0U0UvE+qnouSGfhDsT91n4JuiiVf8CGj0B2 pzB55ezf1IwUBvUbb/BtJZMcK+yWZL9QEkK0AhlllYfuY8OZT2yOY09dE0Rw9SP99yi5 txMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XtjQ+pDs; 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 z9si727188pgz.111.2018.01.19.09.17.15; Fri, 19 Jan 2018 09:17:30 -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=fail header.i=@gmail.com header.s=20161025 header.b=XtjQ+pDs; 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 S1756058AbeASRQr (ORCPT + 99 others); Fri, 19 Jan 2018 12:16:47 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:43406 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755949AbeASRQj (ORCPT ); Fri, 19 Jan 2018 12:16:39 -0500 Received: by mail-qt0-f193.google.com with SMTP id s3so5494937qtb.10 for ; Fri, 19 Jan 2018 09:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=e+42sYQc7Y+YIpCJT3NnNLxrhssWIQ9gO582Evushd8=; b=XtjQ+pDs2+i/z6dKEPMNTjlCDCLtt/PIJu2nBR0+4J433VlQv5lKjSPn0l4eLpiEZ2 cj3x1QsiYeIMOoL0FAJ3D/aLzLsVBmMxdX594vm0Jh650HQ5jWpB2RXUIB+k22kP27gL vpPAsaY0VbG5/wkUwt9cEbSLxvmW+vsWiwvGsiMujFr0Rxj5ammx9nfRJn9MRqhevRBh yHPolp+uqfhrTRnT1OrotLArQK/emNlNtSIDcGGXa7DHcrSXyOKRBTq4rZbmm41gwDlk c20FuIZGp0/yw1laVuecJRTjJ6VDzqLbNySKwublietf/K/T/vwhICr6iXlc1pXQEzoI FUgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=e+42sYQc7Y+YIpCJT3NnNLxrhssWIQ9gO582Evushd8=; b=N2Mi6KAg41sm9Yj1ClQ3fMq5qxx3dC9d+VE0XH5rEEjozqgx5VlPU0+iWyrIi4CxQE 3qmCKmNfk3YUpJdf0JD5LWI7mOBiLoXxFVM1Ed1MAABbRd4c0Zv3+nXSY07OEcejg+Kb Rj0ltCYCVckQ3Llafxu/i/XAW2ShgCqj/5iZ1tg0JQMgLGKk+T/c2fDked2sljeJqmas vtQ2CYSq8Q9ML116whBFJ8RsorU4deYM1z8gHmQRY5xbhp9XL+9U4wj0ZOJk9YfTJPy4 G5kqaRFjnIG0C1+gKxEoPZ3cixDgky3RxTdTqV3q+61whVI2Tc4++0SPp7GO4Za3yrun ixKg== X-Gm-Message-State: AKwxytedn7jDiJy7mfbVzFBXtdu9KQwfGqQKmXlz8oAGAK8IKr2cnq+Y txWtryroQPaIrs0nyiArC20wUFi2 X-Received: by 10.55.25.95 with SMTP id k92mr73061709qkh.22.1516382199124; Fri, 19 Jan 2018 09:16:39 -0800 (PST) Received: from localhost (dhcp-ec-8-6b-ed-7a-cf.cpe.echoes.net. [72.28.5.223]) by smtp.gmail.com with ESMTPSA id z140sm6201402qkb.51.2018.01.19.09.16.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 09:16:38 -0800 (PST) Date: Fri, 19 Jan 2018 09:16:36 -0800 From: Tejun Heo To: Ivan Vecera Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH driver-core] kernfs: fix regression in kernfs_fop_write caused by wrong type Message-ID: <20180119171636.GE3460072@devbig577.frc2.facebook.com> References: <20180119081854.13609-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119081854.13609-1-ivecera@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 09:18:54AM +0100, Ivan Vecera wrote: > Commit b7ce40cff0b9 ("kernfs: cache atomic_write_len in > kernfs_open_file") changes type of local variable 'len' from ssize_t > to size_t. This change caused that the *ppos value is updated also > when the previous write callback failed. > > Mentioned snippet: > ... > len = ops->write(...); <- return value can be negative > ... > if (len > 0) <- true here in this case > *ppos += len; > ... > > Fixes: b7ce40cff0b9 ("kernfs: cache atomic_write_len in kernfs_open_file") > Signed-off-by: Ivan Vecera Oops. Acked-by: Tejun Heo Thanks. -- tejun