Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3709539ybp; Sun, 6 Oct 2019 18:26:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCCRPp6TANgmsSARq8xIf4pBpTDKc6u3Czaczdp4lVNICVM0vh3ictQttUJtFRrbMZyMOu X-Received: by 2002:a17:906:7e06:: with SMTP id e6mr21568423ejr.149.1570411571264; Sun, 06 Oct 2019 18:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570411571; cv=none; d=google.com; s=arc-20160816; b=LU+na9cLcmpEZQudtJP51n5B8+oqK8uetuUM80M5YMLLlbew/vNqMHXgOkBfg8Wgi2 fVgaQV4A5tCaOWmrtyL7eqMTKDUpM7tazDJlbHC4FSGO/HtcriSXdDkqPKwObU8/CdtI EwZEurFMD9GWjE3MnOlThq61s89t+LAeW+vC5KYoVBx6wm3qKP9WWAd74tgT5qdBFQyZ 1D7SQNqIYQuNSHwsPMUlTz2OQ3naL3wcadyMMBtlqABeAuMxsvdKYZ8GUFIp4TnwxFqj zNAq4Vpy12+tEe0hc76ksmO7E9o/gGMtoNNJPZGpsS0pK/q44wDlNKWNEaUmRXor0D49 M4xQ== 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; bh=L8J3qhDAV0SFDmGB33R7GBhdTFXkAXnu4duB0joDPPk=; b=BcigF5xRIaBGpHFkfd4oStsWaaOU0VlbsHFtmT7dFjkHXo6+OEf4EEqGruVcjjxnTl H4/lf9qdWVXlluS9Z7n2hY3Kljld+I4DZ50pYaf4YuoUiSlyty7hlf6rUhaYGesQghiP gELYZFXH3VQ4K7eFYFNZFS7vr0eoUY0I5X7/bV54GhOZH7BhHQ7n/KZOQ+H4WEXAET0t BMLml18nS3SwsiGctwPfOY7Yp3OU20Kzc46cUyyYec9pcb6DnwSSufjsEqp8vUy557Gw KWmkPhgLr70Mj8CxZNdW30QbOQrXEfYrN2vbEDsnW6WC8cN5Jp2SJPQ/nKAHuNgjBceM 5sZA== 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 d1si6373321ejh.281.2019.10.06.18.25.47; Sun, 06 Oct 2019 18:26:11 -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; 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 S1726877AbfJGBYk (ORCPT + 99 others); Sun, 6 Oct 2019 21:24:40 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60000 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbfJGBYk (ORCPT ); Sun, 6 Oct 2019 21:24:40 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHHlN-0004Sd-Dd; Mon, 07 Oct 2019 01:24:37 +0000 Date: Mon, 7 Oct 2019 02:24:37 +0100 From: Al Viro To: Linus Torvalds Cc: Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() Message-ID: <20191007012437.GK26530@ZenIV.linux.org.uk> References: <20191006222046.GA18027@roeck-us.net> <5f06c138-d59a-d811-c886-9e73ce51924c@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 06, 2019 at 06:17:02PM -0700, Linus Torvalds wrote: > On Sun, Oct 6, 2019 at 5:04 PM Guenter Roeck wrote: > > > > All my alpha, sparc64, and xtensa tests pass with the attached patch > > applied on top of v5.4-rc2. I didn't test any others. > > Okay... I really wish my guess had been wrong. > > Because fixing filldir64 isn't the problem. I can come up with > multiple ways to avoid the unaligned issues if that was the problem. > > But it does look to me like the fundamental problem is that unaligned > __put_user() calls might just be broken on alpha (and likely sparc > too). Because that looks to be the only difference between the > __copy_to_user() approach and using unsafe_put_user() in a loop. > > Now, I should have handled unaligned things differently in the first > place, and in that sense I think commit 9f79b78ef744 ("Convert > filldir[64]() from __put_user() to unsafe_put_user()") really is > non-optimal on architectures with alignment issues. > > And I'll fix it. Ugh... I wonder if it would be better to lift STAC/CLAC out of raw_copy_to_user(), rather than trying to reinvent its guts in readdir.c...