Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp746674lql; Mon, 11 Mar 2024 16:59:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+pYuS4muel9bZhY3dHbxVkn6eY24C8sF2sthBvGm21OKX2+J4BnhFoD2ObEMOIW5BLwxAfrCxWCfa7gquPfdC3Mx51jwAGTKlHz9p+Q== X-Google-Smtp-Source: AGHT+IGdV7hWA/ajhzRjUnuH408JkIgHR+IFo++3ZKZZ2peO4uLyB30KHuvumINx7y+RbcnpsokK X-Received: by 2002:a25:db09:0:b0:dce:53c9:4d9f with SMTP id g9-20020a25db09000000b00dce53c94d9fmr6143224ybf.58.1710201573733; Mon, 11 Mar 2024 16:59:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710201573; cv=pass; d=google.com; s=arc-20160816; b=pT6mQHuYgpJGHNnwnlo2wLtM3aJgZUotz1wkj0X23hVJQrwSbWhhsYN6hEg0oh2IGn gSKnKTo+vyeL/eMD+bWFFMoRpRD+BOtCjc8ecZs2DxM7kEcEQUqAQwb/cIOlwGcAghRC h6zusehXAUWd3UYiicNJgVNlvJ4idZaqld9OQFp9kSDNmvCcu5oaC/HZZFpPUQiLcix5 LDMZVWqa8EXNA0KUpz2lWZDaWZCVfs8dko21o8NztbwPekI73AHOv445B0iIZGe26eeY WrvkdLmIEJEIw2HJ1QKw3cMtgKDAsTD+Xpl5W0HKsjiiJ3CIUN3WErRa128TqJd/s1BT k9eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=bqpi+pK0eQZfpPuAwyq71F3S97nx5NBT8dYXZNYP/vo=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=N57Z/TbmXlnAV45bIsLlLDVnM6xlu+1ZJOumvJy7wFvNbCPFz7/nhd5bsn9KZ8eKbj S83ifsyHFIi87bF98h2fmbVVwH60Yf7oWD8ocpu6250gdoDBiTdpQaX2PsF6G+Pu6A+5 coYCxCqnggzHnw0zgHkeaKBdL2mNhH5ltMG6ucwFVgPwjAK9vco5ZUHd9RsWxSYpuWtF lEdOYngl2nwor0YPjzmrpxjhGcQO72Mnx2tcXOPU25PazqLWOkTxqKGMNtfe27RuW2+7 zOY1CVqH2A+BgWyNLV7+X5HJcvcdMOgQKZAJDk36nQLxpuwtC9E1F2DiBm3llAV2oS67 ycdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=APiIOfam; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-99678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d20-20020a05622a101400b0042ef9361343si6689962qte.445.2024.03.11.16.59.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 16:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=APiIOfam; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-99678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 62F7D1C210C1 for ; Mon, 11 Mar 2024 23:59:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3855A59172; Mon, 11 Mar 2024 23:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="APiIOfam" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25D0158AC5 for ; Mon, 11 Mar 2024 23:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710201567; cv=none; b=hUqQEisRN6BrnRqQ4i1Yu5f3i6NbLkNgHU3AgIRHxe+m3qb6vloK2nw6LGmz2uNwT7/lkEXjuMHmuFA+FSgVVctJV0P/lojxqyQH3g8Xc5qYVw5SNavani32OvIcGQp2a0sxJsnONdEF1mPw/Ihpa1SJB12PgYRpJVywW2G//qU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710201567; c=relaxed/simple; bh=rIUUZcn7u9X1l8vy3qZ/KrxnhM49qrQh0SyhLbwntzs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pxlHqrKO4+9vsoAwuRRiKjKZN5lUDm4z5JFQ0wKhsSzDoQRJZgksonKbe+qQy6vwaxbJ+wlw0M7rIL8Wmdfl58pu6f7JCq933uZx13/DodBvqkduYJrJRVJ/G2pmXb95wrJwgWhl8LGrHyv+450Qs3o83vOML2/XH9j//Ba/owk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=APiIOfam; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1d944e8f367so38660225ad.0 for ; Mon, 11 Mar 2024 16:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710201565; x=1710806365; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bqpi+pK0eQZfpPuAwyq71F3S97nx5NBT8dYXZNYP/vo=; b=APiIOfampZVQrLVxEYypGMkG6vDW0xnkiqycYohM1iBR8HptgfBRZ+lu7J/GVyxcHm s0jep0Iwi6dNfLc3JhVE5yw7rJnXogzxFdfp5G+vXkPR0Y8w7mvmwzHAQcJhJ0ssuhZK JTZ/6yvb4wkjwtTWGoGTndzzg3SIqIigthaLu26daCva4d8K7RR7u59fz8sI3Z+piVL1 A4FjhArz8P74uANkDpXpnDgNvP4zjhqEup+cSS9x2JqA8MLYk311NsHmMXSDK0Xe9BA7 5zxYuzyUylhMNs1QVT7aZ2urd4jscZRhQcc9Hgn+Y8GMMym6kcxuS07QSO9xqnbN559Z WbKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710201565; x=1710806365; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bqpi+pK0eQZfpPuAwyq71F3S97nx5NBT8dYXZNYP/vo=; b=VXNmH1pylYg24UmqSjElw0GIhiGuCJRPdlMas6O43ftY87gqbVbE3Loyv6YNGRlKXi Ul+lHO/bL/Ma8DRcWnCOfhmGnD1sXw1PRTqmgRML6/LDeucybOPWBY+OshDj4Uc+RFdG hkDVhKyA8hKg41gdrSqJLxzu5yonc4BaM4dq6BBoWr2FO66J/ytsmIvZvUgNZY+o06PJ 3SdahG6CYAPY20Cz4gEb2Jgqqh7zx1cmlSPNYP+gfqJTrUQukZwFnH5WsuNcAGES8xhS odrsyN3LgkxxZflddWw9z2EJgtLTX2d0JUJXjkB/MV0ITat00uRupRy6EftFyx1cjYEk ZGSw== X-Gm-Message-State: AOJu0YwKmWHrpKHh7PBLZr/zHqQuHVegzFOPfLCVqDRtGkzCVo2sdc68 g5+7N1Rq0k11k95eyw+78uO7OCvh4LaP6Rhs+okz4JTgXwPeH3F7j9sk4n+G X-Received: by 2002:a17:902:e801:b0:1dd:5872:386a with SMTP id u1-20020a170902e80100b001dd5872386amr8937023plg.59.1710201565055; Mon, 11 Mar 2024 16:59:25 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:0:1000:8411:d706:f56a:f0d2:75d]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b001dc8f8730f3sm3473272plc.285.2024.03.11.16.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 16:59:24 -0700 (PDT) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH 1/2] f2fs: prevent atomic write on pinned file Date: Mon, 11 Mar 2024 16:59:19 -0700 Message-ID: <20240311235921.1832684-1-daeho43@gmail.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Daeho Jeong Since atomic write way was changed to out-place-update, we should prevent it on pinned files. Signed-off-by: Daeho Jeong --- fs/f2fs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 1c044fb19c87..82277e95c88f 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2085,7 +2085,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp, bool truncate) inode_lock(inode); - if (!f2fs_disable_compressed_file(inode)) { + if (!f2fs_disable_compressed_file(inode) || + f2fs_is_pinned_file(inode)) { ret = -EINVAL; goto out; } -- 2.44.0.278.ge034bb2e1d-goog