Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4341348ybz; Tue, 28 Apr 2020 09:39:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIR9h6NUZhKiP4fscv9HnXDfah2ySnTVyQmKpLrVINW59Fc9ZlqffbUkJRvxGhzqMc+/hZE X-Received: by 2002:a05:6402:2214:: with SMTP id cq20mr11087854edb.320.1588091967221; Tue, 28 Apr 2020 09:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588091967; cv=none; d=google.com; s=arc-20160816; b=KpP6S/NOusskBjyX6MZ5sZveQri724LQPfVVUXW8KoGTKy60bvUCijR/VSRC9lgSRo xcWY1FaeG1PyZXwSwwKAQfIdFGIBrbJcwO6sRVPUvvUzOaBU4VHbUIUDJJZ2o7IILegu XiYXm20uSseRh+wF9AWhWIAt58K2WJpxS4O61cPTENTmADIgw6hkWEUZOdI6VKjlUWDv VGhY6Ezl8DvIiOV9l64V817MHtRqCaI793nBFBF1Aw0UcVry0leuIaIJYKkBEWuRIZR5 59bt9ZzKOCBxxCU4JaOt9xpDZYBaFbTBRUeI3Ad3TDPMmAAw1Bp6EMwpPHY9fZvsnIaf /zcA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=X1mxB9/IGko7NMD61SzKMJ6N+5CrxseMyS9QSJMcFa8=; b=F8ho4oKZEVl7IH6DKJ8oOgvTWLig/9CoIUsAXwXxX/uwe0+7pB/OAc4aeUQ1JBofJ8 6CBAONSUqX3CS6XFUBWtMOXwh2InFCZ8pNqY/H5qi4P23RGlLxLpprIMtkNyh/XGps6d 8X+3UAnZ+JNyYCLgE4iqCGedeHNMst0bcTE06gsZTtWlkqUe0JdI6rbhEG6LhVY4wEKg skIY6eHMxKrEMFRwYmc7zVP0nO0KmcM0gP3y5RwkehSboSZrAuxXw98/iZ6HOSMOb6H3 iVBscLFvl45p8Fba1svTTNq+X8St78/hNcpWA4cR5giq4MAksQbZ44xNFUfNoAVdLXin g3dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=P2gmUuJe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si1979210edi.150.2020.04.28.09.39.02; Tue, 28 Apr 2020 09:39:27 -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=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=P2gmUuJe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728442AbgD1Qer (ORCPT + 99 others); Tue, 28 Apr 2020 12:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728425AbgD1Qer (ORCPT ); Tue, 28 Apr 2020 12:34:47 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55CCAC03C1AB for ; Tue, 28 Apr 2020 09:34:46 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id b13so33726435oti.3 for ; Tue, 28 Apr 2020 09:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X1mxB9/IGko7NMD61SzKMJ6N+5CrxseMyS9QSJMcFa8=; b=P2gmUuJe0DstX2vgN0Ni/w0KtohF47LJu+m1YD6o2MhJph3OhDGfCMX3kfeuPbTe6s +Yx0QUbqeydOQ7R9iA0uzl5gRF2b46ZUrZE1tz5dUwhCkrn6Wp65KngYgrgw9k2qoKUw 4obGgXJ1hfdWjXXkqPhUc4iVmGZxStY0gNQW4KHPmLkDJlbIjwZ3EhBTRWL+sFFAN+Rs ZBByFIr1qhZi1+pPihwU9diWqs6QNuinXSD2vV5/DGmcbo0Zu25+jRTDpN2P5m9mhnvY XdwSXghIW/jo0xnd2AUb2IRHi853sVeYids/nMK3z0Opm82c3EuBnpHHJT1418slgMnI EuNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X1mxB9/IGko7NMD61SzKMJ6N+5CrxseMyS9QSJMcFa8=; b=VUAw537sOanTTeTWHD+vcTw1Amms8xR3lPzwfWeMhDU5lINPJSi86zoKWlTn8VrWTm tyZpJQZvuDZolvWnnaTv6IuvA/rnGPit9B37u9SK9/C2Ae5DLJr1DKt+ZTpC7zkhDXke FM5PkoBTaUhNBH8QrNhhHxZcbtSmH7Ju9ier0YMXaYlkXs1L7gn6QRMO/YBqF7/4bG/c lHLFtizP2x8jLczL8El1zOYx3XDWaDFTr39wypue1AutCzZnTkcpbix9QiSno90Q/tBC AhP8Mjjyh69xuvKJ0p8cEngRapSKNxAkgfJFbNQHOAHl2P0EBTXW7BulObqMtsNzUwjz XILQ== X-Gm-Message-State: AGi0Pubfei75c90TXPFpwVo/ooeet4eIZFp+JNi2kD+vz7VdssQgLD1k c2ikaPTDYxOpaBGVHMgEFfgYMA== X-Received: by 2002:a05:6830:108b:: with SMTP id y11mr22380696oto.88.1588091685653; Tue, 28 Apr 2020 09:34:45 -0700 (PDT) Received: from [192.168.86.21] ([136.62.4.88]) by smtp.gmail.com with ESMTPSA id t5sm5171612oor.36.2020.04.28.09.34.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Apr 2020 09:34:45 -0700 (PDT) Subject: Re: [PATCH 2/5] coredump: Fix handling of partial writes in dump_emit() To: Linus Torvalds , Jann Horn Cc: Andrew Morton , Christoph Hellwig , Linux Kernel Mailing List , Linux-MM , linux-fsdevel , Alexander Viro , "Eric W . Biederman" , Oleg Nesterov , Russell King , Linux ARM , Mark Salter , Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Rich Felker , Linux-sh list References: <20200428032745.133556-1-jannh@google.com> <20200428032745.133556-3-jannh@google.com> From: Rob Landley Message-ID: <94141fbb-9559-1851-54c1-cdc5fc529a1a@landley.net> Date: Tue, 28 Apr 2020 11:40:47 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/27/20 10:35 PM, Linus Torvalds wrote: > On Mon, Apr 27, 2020 at 8:28 PM Jann Horn wrote: >> >> After a partial write, we have to update the input buffer pointer. > > Interesting. It seems this partial write case never triggers (except > for actually killing the core-dump). > > Or did you find a case where it actually matters? > > Your fix is obviously correct, but it also makes me go "that function > clearly never actually worked for partial writes, maybe we shouldn't > even bother?" Writes to a local filesystem should never be short unless disk full/error. Once upon a time this was yet another thing that NFS could break that no other filesystem would break, but I dunno about now? (I think the page cache collates it and defers the flush until the error can't be reported back anyway?) Rob