From nobody Thu Dec 18 19:06:12 2025 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 9F83B13CFBC for ; Mon, 29 Jul 2024 09:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722244014; cv=none; b=ZeUC7IQLfsCxtwXwzKtDkTTMfU9d+LBJE5ms2/NFGtEonu3QJWYJVX7NsbkHlguHBT55WV5OffcDP4USF7KtFuDYuc59ztxwkm0EpKGDcdM9AUCbspUfdnVqtZNGlh7ktG5LrGfXwuk3dJI7uC7YIjB2YiG4CS8VkBDGmxL+Ta8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722244014; c=relaxed/simple; bh=hykvftg3vhQtA4vVyQKMdRddESCKg0yCsxhDTFA9jWM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qx2/VExSu/0UmXHYZcJeERxoZnSowFZoHi184D3fy4aU9OY2bWDEjxD0Y2XCI/BKLhxSEM80u05cOo6sbNKsnLHOW/7HrAPnUWIyW6NBllRpGwR2t12Kv1cvAHNCBhmYRrUFHwe19wXbvTMGzcr5mJTqF4RMLamfJLIJ3CxoN/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=UIRM+pa3; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="UIRM+pa3" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2f035ae1083so43159671fa.3 for ; Mon, 29 Jul 2024 02:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1722244010; x=1722848810; 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=7iJw9k6D1Ud7dg7cELMS+oQmF5+B7DIbU5iHUw2ERek=; b=UIRM+pa3ixAnUoVh4g5qMCKIxJIMQIyxA2EIAAiyV94JGCFSDGFCxeYoemZrIxjjqC lbtOSHZW7xkP+clvbV09jvOQOWYGGRTIdpxiEZKT0k9KiRHt+Mnuo0oC014EXEWz/YSP Hk5aFgpOcQy+S+RSG9oIqZd90J9KIQcj3MVTifBYc0f4rWMUTBd5WMBukswmE8CPxIp5 P1WR58BBLeaYwthiZFCAfP6kc2lZCGZ2ls2En921/ZAlV7tswXyTO3Sbs+1YOWJekhBb tMu4CqFsmFKmvX1HaTeHfKt6uk2J0/elPbF8tsQ92h1IiiL1gai2PNJOsAPWbuNEONdQ xA2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722244010; x=1722848810; 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=7iJw9k6D1Ud7dg7cELMS+oQmF5+B7DIbU5iHUw2ERek=; b=ck9mn63ZvV9TMNNTZyCaDqSu+6v5KAh73p1IxV2ZTBDscqghUggfvlqzsiklLawox1 nWy0huDdtOJfm1AMWbspf/ibnJnxAHoTN3aRjRjQmeFb+sOYVaA2ZYJj4IvRC1kHcYB3 cXQRDxrelp62sImaCg+HbfNvEebx4B35MJp0CW02n9RpbePpCZPos/kOjR3R2qvwW8O+ ioKN+0EhdiO7Qy18dSSGKLscJMBy2Ssvroiu9TmcW09RNESVUEc1/3LtfaLp02zgXWph Bx+e25tC7YHn3AO4mry51yzV9SPLoeXmp3KakauhT2Mi4CgScjr8zv0NTSfLMjLli/6P SfNw== X-Forwarded-Encrypted: i=1; AJvYcCWBZUe98HDnAdIkJn/+felslweUzFD8PcFLODbQY8h2Jj57OMQvSuIQo6ldJG6RhfvhluIT9YdLWkZq7SETTbEeqiZQoaBqcZZ7ZHcH X-Gm-Message-State: AOJu0YwSo7n+7PqEsbSfiQj6Fx1FNbLBY6lvDrnsiV9is+P/kRpqI88X SfLlR7BHpRp+zgOhdRbWgdW3wQn2vayttLLpwzJjNuZPnxf4/s/wEZs739enhpw= X-Google-Smtp-Source: AGHT+IH0aAp6nqFToH47ycIHryIQNXERRaRXnmdtYJYfX6Q5qoO3wtejC77Lmfcly4PoTitp0zXv9A== X-Received: by 2002:a2e:330e:0:b0:2ef:2472:300a with SMTP id 38308e7fff4ca-2f12edfc2a1mr45943311fa.2.1722244009483; Mon, 29 Jul 2024 02:06:49 -0700 (PDT) Received: from raven.intern.cm-ag (p200300dc6f03cd00023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f03:cd00:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac63b59bfesm5456620a12.44.2024.07.29.02.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 02:06:49 -0700 (PDT) From: Max Kellermann To: dhowells@redhat.com, jlayton@kernel.org Cc: willy@infradead.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Max Kellermann Subject: [PATCH] fs/ceph/addr: pass using_pgpriv2=false to fscache_write_to_cache() Date: Mon, 29 Jul 2024 11:06:39 +0200 Message-ID: <20240729090639.852732-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This piece was missing in commit ae678317b95e ("netfs: Remove deprecated use of PG_private_2 as a second writeback flag"). There is one remaining use of PG_private_2: the function __fscache_clear_page_bits(), whose only purpose is to clear PG_private_2. This is done via folio_end_private_2() which also releases the folio reference which was supposed to be taken by folio_start_private_2() (via ceph_set_page_fscache()). __fscache_clear_page_bits() is called by __fscache_write_to_cache(), but only if the parameter using_pgpriv2 is true; the only caller of that function is ceph_fscache_write_to_cache() which still passes true. By calling folio_end_private_2() without folio_start_private_2(), the folio refcounter breaks and causes trouble like RCU stalls and general protection faults. Cc: stable@vger.kernel.org Fixes: ae678317b95e ("netfs: Remove deprecated use of PG_private_2 as a sec= ond writeback flag") Link: https://lore.kernel.org/ceph-devel/CAKPOu+_DA8XiMAA2ApMj7Pyshve_YWknw= 8Hdt1=3DzCy9Y87R1qw@mail.gmail.com/ Signed-off-by: Max Kellermann --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 8c16bc5250ef..aacea3e8fd6d 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -512,7 +512,7 @@ static void ceph_fscache_write_to_cache(struct inode *i= node, u64 off, u64 len, b struct fscache_cookie *cookie =3D ceph_fscache_cookie(ci); =20 fscache_write_to_cache(cookie, inode->i_mapping, off, len, i_size_read(in= ode), - ceph_fscache_write_terminated, inode, true, caching); + ceph_fscache_write_terminated, inode, false, caching); } #else static inline void ceph_fscache_write_to_cache(struct inode *inode, u64 of= f, u64 len, bool caching) --=20 2.43.0