Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2680240pxb; Thu, 11 Feb 2021 20:47:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJww7SyO0NizM7pVFz9XwAleTx5WUy9QSX0pH4UoDgcAvEDzY5+Y8aoNQD+H25VrQhLOLfrO X-Received: by 2002:a17:906:2bc2:: with SMTP id n2mr1127244ejg.381.1613105273327; Thu, 11 Feb 2021 20:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613105273; cv=none; d=google.com; s=arc-20160816; b=QDDrBNaGAjSyI2lgJEqFrlrGVkRq7J4mOMxaTliE0gsp0PttX5cCWK+W98SKjg0wdu +bjQJsHno+9RSCedq0dB3zPoo/AdgAVqYagf7pNxahXe4/j5W2f50sjtso2s41h4Dn4H QrZD2OqQLf4i5Bc4vHDcH/5AOCbKSlAsn6ImhcEojWahTITE/7QsRo9ZkE0f7FH8oMyX MGFrxI5m9w1Z/q1VZ2XPawmZxCHNPhnnzVD67nj1TYcqcs4HDA9SmOCnISHR0leiILOD 479nPf6hdTsAr+GswT1QF8nS4/qVURMDihCcAAJ7E+LbxmCbvRxIR1aiPUjlYvNUh4Au v7lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Uwr/8PJUNMrs1DNHiVxSJVanvT/KDCxxvdzqAMfX/20=; b=B9wPvlXanstHdOvFTdswN3Tys16T9ZPP0roo58gTzBsZnGKwonOkEiztdS/A2mXEym 5MJVq1rd8ds5ZrMFQfw2YgOA6pqdAXMxZCljm3dEvRiU4ym+bNpOVlblvPkxhtuCvEcE ucKNZ99zphSq9ZLzBOaPv081ct80EdkWwLm4X32OfZ3mUCiSF0+dQayih+c27dqvkVJT Vfzq/S6zRJilxq3T3HA+CSGk7gtPtyo6DuexQyYarjq1ZFkoD3FwTT9YNODnUDnjjsTo e+lJNUbWOUdia79AeSygRNeSyBcGOJWD3NFNEbYFy7djt2ZjE+qeP/n4iPlggGsPnkDE 4lyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jDPV6GnS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si5443309eja.248.2021.02.11.20.47.30; Thu, 11 Feb 2021 20:47:53 -0800 (PST) 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=@chromium.org header.s=google header.b=jDPV6GnS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbhBLEpj (ORCPT + 99 others); Thu, 11 Feb 2021 23:45:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhBLEpZ (ORCPT ); Thu, 11 Feb 2021 23:45:25 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F07FC061786 for ; Thu, 11 Feb 2021 20:44:45 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id b21so5457170pgk.7 for ; Thu, 11 Feb 2021 20:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uwr/8PJUNMrs1DNHiVxSJVanvT/KDCxxvdzqAMfX/20=; b=jDPV6GnSoh0tUu9SL3pV6ZNkNlrVV4nNS5weOpmxNEER4+qGUF4kuWbxGzf7zUe4Q6 0fNbc8n6aPmawRsXKF60jjdrAlO3PQ6/lKXdvfCYNb1N+gAjmCFqexp/zw0kQUWuFKmo tsPTSYVURrDD1QkSKI9JBQAqmySDiCWcOQCeI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uwr/8PJUNMrs1DNHiVxSJVanvT/KDCxxvdzqAMfX/20=; b=CepYRJDcn8ST26p0WKgKwIUyP5mOktzMi74CeldUcAihiCpV6uSOQZ2OsqyXPe31OP 8sw3Os5cweIpWJEFGdSXsgX9NU1wULwVH++vK4ZRVA8XWBlIPvRJi/GbkQS10XmiBQaN Ax/v81r0+ZNwven7zvfmQv8OvYgASzof4AXtn4NBb1q3V5yZdPhcAAQPtY75Z3zINNLD YrNmCTL9X+Jdh15pf7/Edoo0VvxjhLHVc6Swj0HoPPDGRd7HNhEry+3esaVvRIjHoMAm yTInl7IRa04/OrCzekIF5njoklJZ6I4HWalh5GZDthC+IJbl2jrQkYAHLTAz1n/FDjJP 4fuQ== X-Gm-Message-State: AOAM530C3246nhuiuHAR9sfqw3Y9nFyY9To/3xYVmb4Q93FMLBhQhxim aEzguRfxpQIH6D3hwV0FboOjnw== X-Received: by 2002:a63:1965:: with SMTP id 37mr1468628pgz.349.1613105084885; Thu, 11 Feb 2021 20:44:44 -0800 (PST) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:a453:d6cd:41b9:5925]) by smtp.gmail.com with ESMTPSA id 25sm7298904pfh.199.2021.02.11.20.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 20:44:44 -0800 (PST) From: Nicolas Boichat To: "Darrick J . Wong" Cc: Alexander Viro , Ian Lance Taylor , Luis Lozano , Greg KH , Dave Chinner , Nicolas Boichat , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] fs: Add flag to file_system_type to indicate content is generated Date: Fri, 12 Feb 2021 12:44:00 +0800 Message-Id: <20210212124354.1.I7084a6235fbcc522b674a6b1db64e4aff8170485@changeid> X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog In-Reply-To: <20210212044405.4120619-1-drinkcat@chromium.org> References: <20210212044405.4120619-1-drinkcat@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Filesystems such as procfs and sysfs generate their content at runtime. This implies the file sizes do not usually match the amount of data that can be read from the file, and that seeking may not work as intended. This will be useful to disallow copy_file_range with input files from such filesystems. Signed-off-by: Nicolas Boichat --- I first thought of adding a new field to struct file_operations, but that doesn't quite scale as every single file creation operation would need to be modified. include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 3482146b11b0..5bd58b928e94 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2335,6 +2335,7 @@ struct file_system_type { #define FS_ALLOW_IDMAP 32 /* FS has been updated to handle vfs idmappings. */ #define FS_THP_SUPPORT 8192 /* Remove once all fs converted */ #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ +#define FS_GENERATED_CONTENT 65536 /* FS contains generated content */ int (*init_fs_context)(struct fs_context *); const struct fs_parameter_spec *parameters; struct dentry *(*mount) (struct file_system_type *, int, -- 2.30.0.478.g8a0d178c01-goog