From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E603C83008 for ; Tue, 28 Apr 2020 16:40:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 316FE206D6 for ; Tue, 28 Apr 2020 16:40:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Qu+2TQv0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 316FE206D6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A9C0F8E0007; Tue, 28 Apr 2020 12:40:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4BA98E0001; Tue, 28 Apr 2020 12:40:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9131D8E0007; Tue, 28 Apr 2020 12:40:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 7A4F78E0001 for ; Tue, 28 Apr 2020 12:40:43 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2AF9B2484 for ; Tue, 28 Apr 2020 16:40:43 +0000 (UTC) X-FDA: 76757827566.14.range89_637cac4e7e52 X-HE-Tag: range89_637cac4e7e52 X-Filterd-Recvd-Size: 4614 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Apr 2020 16:40:42 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id g10so17366983lfj.13 for ; Tue, 28 Apr 2020 09:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lHXIK5KG4MM6NL6ZnqDyJCo1++3O5tMDxa0Oox/FCk0=; b=Qu+2TQv0OYiYE16287sogB8uDjS8JZz9MFHDIwMmE4QWXix8Yj3Rir/mLPwz00RjUg hnk6uNKaE0hzn5zlYIZTWKFCs2u3Lk4U9c8hgRG4h/3lWuPoDD91flVvK19N8QzMsCzs vJ6aDNedAL1ptIzuTwxhsiNW9/aiFum9pNkTk= 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=lHXIK5KG4MM6NL6ZnqDyJCo1++3O5tMDxa0Oox/FCk0=; b=Coo+dYGTfll4UpZL06hRUsQuWDxgaUigBF5LUIYnaIVHesE2TSJ3tvAr9ewFHtfvDW PS14S5vZ3dHeeVaGzNSR9jAVTvHjZ1gLLXeSYb5FNsXYdCzz/ftRzY851T5fNg3SDB6B zjRNEPpxz4MgmlrqH+V1HiG9O7GG3ce/le3f/HheZekFgRXMzGmh7v0tJvmMcqWNjpfz IlXk4KR9NbeeGBcct2SK6aJ6vJReOQBe3x+TQkLtyGUA8rDN55uScAFKrZq4OBYR+aYV 5b2Nl1kiuzat7P9r24NTOi0R4t0UlUPaUJtKnWCl+iJUFd2+++b5IHUyOoH4yIV+afWw 6jKQ== X-Gm-Message-State: AGi0PuYu9GvadfDT4Z999Tcoc5Pbu3ZeWX7iJQEfsWKsy0Ovqnh+0GxK 7LNU4xZ6scqsL/Q9iQ0B+UuZC/U2nCc= X-Google-Smtp-Source: APiQypJRGXWb/prp/w7jwX1BIfKvWWI8fgi8K7Pw/n50U8K7r0Un8+eYlRq2KuP0iW6QfFrbCQ2q+g== X-Received: by 2002:ac2:489b:: with SMTP id x27mr20008626lfc.60.1588092039974; Tue, 28 Apr 2020 09:40:39 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id w29sm2831489lfq.35.2020.04.28.09.40.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Apr 2020 09:40:38 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id y3so1835307lfy.1 for ; Tue, 28 Apr 2020 09:40:38 -0700 (PDT) X-Received: by 2002:a19:240a:: with SMTP id k10mr19924040lfk.30.1588092037785; Tue, 28 Apr 2020 09:40:37 -0700 (PDT) MIME-Version: 1.0 References: <20200428032745.133556-1-jannh@google.com> <20200428032745.133556-3-jannh@google.com> <94141fbb-9559-1851-54c1-cdc5fc529a1a@landley.net> In-Reply-To: <94141fbb-9559-1851-54c1-cdc5fc529a1a@landley.net> From: Linus Torvalds Date: Tue, 28 Apr 2020 09:40:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/5] coredump: Fix handling of partial writes in dump_emit() To: Rob Landley Cc: Jann Horn , 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 Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Apr 28, 2020 at 9:34 AM Rob Landley wrote: > > Writes to a local filesystem should never be short unless disk full/error. Well, that code is definitely supposed to also write to pipes. But it also has "was I interrupted" logic, which stops the core dump. So short writes can very much happen, it's just that they also imply that the core dump should be aborted. So the loop seems to be unnecessary. The situations where short writes can happen are all the same situations where we want to abort anyway, so the loop count should probably always be just one. The same would go for any potential network filesystem with the traditional NFS intr-like behavior. Linus