Received: by 10.223.176.46 with SMTP id f43csp1285172wra; Fri, 19 Jan 2018 09:19:31 -0800 (PST) X-Google-Smtp-Source: ACJfBos+5YHxM0xpA+vJBuTiBFoEyjv6l9uqdvd8load7jJJ5lBYNz2/QeA7OYXiC6M8AA0be+wd X-Received: by 10.101.82.205 with SMTP id z13mr41200607pgp.403.1516382371280; Fri, 19 Jan 2018 09:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516382371; cv=none; d=google.com; s=arc-20160816; b=a2x7+5PDtT3WTTwuyMEwv63Xvgx6zzvyXlKoh+OQsw3fFqI8ZxcUzJ+vomJzZNDmle sWABvAjtFETr/pop7G7wYBjCHMWn04AZfH/9HWQ5uTVOriu9wkXAz/9bZ3zNSQ0rGOlS 7qLXRmffHwjj8gexcEb4M4Lh1MG4++0Q4pM3P9C+R6U1IS23hdptuJ0VaSnCBcq5w60I B/o2aKKGQQCKW7nVW10kC4D/LGHweSlviajP2cfdreZgNHMSempriXHV+8U4xl6jkK+H fEdXaynHTJ5hu1ysiavJQXHmdn7/X8RQpZ6tjrSibtoz8iY/7yoO6/TkOcyMOeRRRsPq zqhA== 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:arc-authentication-results; bh=ZJLAsO8vklmWXv9MAL6OH1O4cqkHRcLUA3lSZGzNMtk=; b=dDWyZv6Fy0aX0EFHO2TbwFqpje7fVel4X+Q9HcYqbuBq+v1Z1pGmx2zCrmjIurpY5a 6N0B/1evtUT/oUlcrnh8l1H2hyZ40tROU7HR8OJY+Q+DMBoEYBVBULpjVFzgttjhL7OR QZoc8YsNvdGIqQdY3SP7T1P1sJjQhofvf09pNrjqlW+v2udJpYSA1fQpzGoFm74+qR3q eGbYHAyiU8r0Y+5Tw2zS5Bu0mQqQiPWSbMqTHkjkcbfHNmF6G7S8qLcp21ZbdZiND2e3 zFeFPQYqW1Hm9BS1hmMK1Dw7IXuBzzZEb675mTiKKAukOU0s1uDnYIuXNsDgGvyDdVW7 jW0g== 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 z2si9261101pfe.157.2018.01.19.09.19.17; Fri, 19 Jan 2018 09:19:31 -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; 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 S1756058AbeASRSj (ORCPT + 99 others); Fri, 19 Jan 2018 12:18:39 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:56422 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755932AbeASRSd (ORCPT ); Fri, 19 Jan 2018 12:18:33 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1ecaJA-0003wP-NO; Fri, 19 Jan 2018 17:18:28 +0000 Date: Fri, 19 Jan 2018 17:18:28 +0000 From: Al Viro To: Tejun Heo Cc: Ivan Vecera , linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH driver-core] kernfs: fix regression in kernfs_fop_write caused by wrong type Message-ID: <20180119171828.GJ13338@ZenIV.linux.org.uk> References: <20180119081854.13609-1-ivecera@redhat.com> <20180119171636.GE3460072@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119171636.GE3460072@devbig577.frc2.facebook.com> User-Agent: Mutt/1.9.1 (2017-09-22) 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:16:36AM -0800, Tejun Heo wrote: > 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 Applied.