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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D3BAC32771 for ; Wed, 28 Sep 2022 21:45:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA4216B0072; Wed, 28 Sep 2022 17:45:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C53006B0074; Wed, 28 Sep 2022 17:45:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1B556B0075; Wed, 28 Sep 2022 17:45:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A00CA6B0072 for ; Wed, 28 Sep 2022 17:45:41 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 635491A0ECD for ; Wed, 28 Sep 2022 21:45:41 +0000 (UTC) X-FDA: 79962826482.21.7520AD9 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf29.hostedemail.com (Postfix) with ESMTP id 55848120007 for ; Wed, 28 Sep 2022 21:45:40 +0000 (UTC) Date: Wed, 28 Sep 2022 23:45:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1664401537; bh=kH+/tmczecKnhnIrUtubeU3tV5TZ91lbO2+kdfSMlPU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GjSj4u/9FSkzVFsqxXdsV5Ch7Bk9OUigNZr321HrEPfCi6qMZY4pnfIV5uQsD7UXR yHPWoSqMls64BbTa8ebsUeur0roeRF2RC+24/7Lt8PFaXFp5yXchf7QVvBXNX5J+To Y8H0vQaWqGDpJS0zLgEQFkRKrs0+OK207otlUfQc= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Hugh Dickins Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Subject: Re: [PATCH] tmpfs: ensure O_LARGEFILE with generic_file_open() Message-ID: References: <20220928104535.61186-1-linux@weissschuh.net> <4d5a721-cffe-cc7-8023-ae86ba35cb7d@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4d5a721-cffe-cc7-8023-ae86ba35cb7d@google.com> Jabber-ID: thomas@t-8ch.de X-Accept: text/plain, text/html;q=0.2, text/*;q=0.1 X-Accept-Language: en-us, en;q=0.8, de-de;q=0.7, de;q=0.6 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664401541; a=rsa-sha256; cv=none; b=3WRkREe1AVcT9FeIYjGG36S0lP/d3bNf91Q46fZollq0V9jkz3lcw8S2niAtAXEn+sx4yf W7iVSMjYrzWMyPkulcg+/uxmU4g/NX011p18AIdYElYR64KJRDfbn25h/TiWsKj3WBYYwk CvPjORoK5LSm8ubX3QP7ZRRLHJkt1wE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b="GjSj4u/9"; dmarc=none; spf=pass (imf29.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664401541; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vr/u5dbjCoVmTrvKlg3r4YDf+csQsJyOmc9mQlnbCSI=; b=2i1unPfYz71I/in+RIsmuHcRqSgOsKqWID/D5lHc+QxQRrmd/cf9f4P27KCDtREBqWJiz5 meSVMrugQBLgKOxWfUhjj0GnPTRhHDZjIJU2VNxO2+88azM9R3lEz2qzxV6+P4BelBGVAk tJWvfeIgal3dZCSqHId3Pw/yLBeFEFA= X-Stat-Signature: 9ot5ho3cuz56xe1u61nbktnh7dmgjp33 X-Rspamd-Queue-Id: 55848120007 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b="GjSj4u/9"; dmarc=none; spf=pass (imf29.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1664401540-463915 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 2022-09-28 13:27-0700, Hugh Dickins wrote: > From: Hugh Dickins > > On Wed, 28 Sep 2022, Thomas Weißschuh wrote: > > From: Thomas Weißschuh > > > > Without this check open() will open large files on tmpfs although > > O_LARGEFILE was not specified. This is inconsistent with other > > filesystems. > > Also it will later result in EOVERFLOW on stat() or EFBIG on write(). > > > > Link: https://lore.kernel.org/lkml/76bedae6-22ea-4abc-8c06-b424ceb39217@t-8ch.de/ > > Signed-off-by: Thomas Weißschuh > > Acked-by: Hugh Dickins > > Thanks! I think you deserve some special award for finding and fixing > such an ancient bug/inconsistency - dating back to early v2.4 it seems. Seems to be my special talent. > But only affecting 32-bit; and since we've happily lived with it so long, > and the fix does change behaviour for userspace, better not to Cc stable. That was my feeling, too. > There are some other filesystems still behaving as tmpfs was (ramfs, > hugetlbfsi, and I didn't look further); but we do make more of an effort > to keep tmpfs in line with the major filesystems - thank you. NFS seems also to be affected, which I think warrants a fix. My plan was to wait for the feedback to this patch and if it works out to then submit patches for NFS as validating that will be a bit more involved. > > --- > > mm/shmem.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/mm/shmem.c b/mm/shmem.c > > index 42e5888bf84d..902c5550fabc 100644 > > --- a/mm/shmem.c > > +++ b/mm/shmem.c > > @@ -3876,6 +3876,7 @@ EXPORT_SYMBOL(shmem_aops); > > > > static const struct file_operations shmem_file_operations = { > > .mmap = shmem_mmap, > > + .open = generic_file_open, > > .get_unmapped_area = shmem_get_unmapped_area, > > #ifdef CONFIG_TMPFS > > .llseek = shmem_file_llseek, > > > > base-commit: f76349cf41451c5c42a99f18a9163377e4b364ff > > -- > > 2.37.3