From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 4E1801E1C1A for ; Tue, 2 Dec 2025 02:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764642492; cv=none; b=h2GjM5dG8mY7hKD4TjVMi6pGPJ7jdmIqxuJo0eBz8Tly8qp9JsYNr69+ESio5gbAUZhc5B2ubTaVC8dgWFQuM0CEO/zfyXk0jjkFSCODAkP84sOXWnJRGP1CQ+7uqHXM4rfKHoE+HBMUH9NOXVcPI9eElXoIZu1R46LO4IbcA8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764642492; c=relaxed/simple; bh=k6DLSLxt2mS92AW9THnTfyPCYL+zu3tAMKUQnsjBdO4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=R3g3lBQZ+jrZZtOYwg6KMX5A49Dkmhlmt7HwDTdrXN3UQrp5yLV/li6+sLPjIht2Hmdo9PwPtlCy8lab2MNHByr4Qc+xowo3FD1Bye6+eC/D7R5/cdrknMNPeOp9m0SoBR6vNzip69CpFNjra0yblN1gLvtZHNkAecJtpxAbAtg= 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=RZhbqjyG; arc=none smtp.client-ip=209.85.208.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RZhbqjyG" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-6408f9cb1dcso7531639a12.3 for ; Mon, 01 Dec 2025 18:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764642490; x=1765247290; 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=ihzWcZQrPg9oGqI6ksnq5pPm895AlT5PWrtOUGngFrA=; b=RZhbqjyGYkb0K1iFb6oCREdhFYBrWMSKrXi8ooEEtfBsp3+sjLSQVqWBbxj2Pdzjjo QsIZhHPml6wOaQlW0qdFKHCSIYaGeFFEfz6o6RFtxzSWu8k56aypxRNiO/L+QF+da/xa +dWC6JPYRWaypxSeOiKOH3CnMsZjjoeN9x47kb/zL6AmXeE4dBlslmGHWQe6XEB+B2k6 Y7SCfl7Fib6RjuJiNuuDlQgQGwwxwmdYNyHiFz1zIzpJ8QVOQXWCbiEh13igsjM6TEow iuWCLOy1rN+mQ/0+5eyomtzWmV/QSV1nCZDWrtZyC150VqAi72f5OLLDwWn+stNjaG+g EgRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764642490; x=1765247290; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ihzWcZQrPg9oGqI6ksnq5pPm895AlT5PWrtOUGngFrA=; b=NwPr2YhGE2Ga3fP8NP/CPqKTrlCFCJrkYqm+BQqQzNyCGVB1vIXOozNAlkeuN/p8he tA7dNfrUpF1WeyVA/rioDdK2EJ4LRM7dJlHKdssOt/0KaGNMWSSdUj3r2BrJ7fLwnFl8 I3L+efjcmSPYEtEsm5B1It+JOK5G4Njkz95jeR+6z2puqHaw5SIGlxrZBkP2K+pz/tdM Y59ASmmpZSY/CiuLf6VI6aTJQiIY7ZOxaa3mbGHCFe15BV0xI/VpSByuyhLUDGBD9U76 uLacGTdjlD8wjAkMlWAFFqviL/Jc2l7BO9r8HmohOJKk/s+s51XhfpCgwxnlHZDvephF OIQA== X-Forwarded-Encrypted: i=1; AJvYcCWvriNDt+f5A/fzzQ1GdwwROd28JlYPk4TbEI/geVc7DuecSxMgj1aU8gg6pCYDj1epPN1U1gA+FlTF3c0=@vger.kernel.org X-Gm-Message-State: AOJu0YyqKVLhpe0rm+WSWfWLqZCKYPh4QJ3ItOYeTbOKKadv3LQQtoDL FViPFoyS9bkdWfZVTneU8jU+/+r57oP8ZGfnJ4JvVz9VCoGWTvdpVsj1 X-Gm-Gg: ASbGnctkmuAW2T+B4T6YSAYAQPVDO4MJUsDe//+sbofD33DnSELLYPG+TgbgKT668GB zeoMUengZsWbdp3fle1D56z4tXbc0M126bgchKwddzdTHl2Mifk/0p0S6HvDvQOoKyJywRjaoXP JmPs1ZzEwHIQ/ysvfgAm+RSuETkHWCX+bvTyk9hsPGtDzQ2wbJwTtqiJQVXJ8wNKlkU6F0/Ahqd HIQUcBkXwzhXtECs8lnWgUuD1gmbgBRiJ57DFrWm9pI5pmRVn6fHWAciU526bS/fCUFoTtFbzTg YxA7LFhmRikLRbWYXRqhFmpwKJP1usJ5ctYpSTAiSO9WnuS7T4xyXgRdsymZae4Eo+TXuS3WjCE 3ApTC0Foxx0/DndDxrl8aAnqTjLryiUgMUofXmXLPYX+4Li3byiZPNsK2X4ywDVpCMaMIbLc7AS yyOOg2h0lI6RE= X-Google-Smtp-Source: AGHT+IFkadxZWcYPuvorA2AO9KAXSopWYAM81WvbAebNpNfeijF3ooa5mGoe9cC118IBcnJ+Zx8DYQ== X-Received: by 2002:a17:907:6eac:b0:b73:42e5:a59e with SMTP id a640c23a62f3a-b76c5355c0cmr3001160566b.12.1764642489633; Mon, 01 Dec 2025 18:28:09 -0800 (PST) Received: from eray-kasa.. ([2a02:4e0:2d14:1a1:8eee:b306:2d20:a328]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b76f59a6a5csm1398317766b.41.2025.12.01.18.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 18:28:09 -0800 (PST) From: Ahmet Eray Karadag To: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com Cc: ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, david.hunter.linux@gmail.com, skhan@linuxfoundation.org, Ahmet Eray Karadag Subject: [PATCH v2 0/2] ocfs2: Refactor read-only checks to use ocfs2_emergency_state Date: Tue, 2 Dec 2025 05:27:58 +0300 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi all, Following the fix for the `make_bad_inode` validation failure (syzbot ID: b93b65ee321c97861072), this separate series introduces a new helper function, `ocfs2_emergency_state()`, to improve and centralize read-only and error state checking. This is modeled after the `ext4_emergency_state()` pattern, providing a single, unified location for checking all filesystem-level emergency conditions. This makes the code cleaner and ensures that any future checks (e.g., for fatal error states) can be added in one place. This series is structured as follows: 1. The first patch introduces the `ocfs2_emergency_state()` helper (currently checking for -EROFS) and applies it to `ocfs2_setattr` to provide a "fail-fast" mechanism, as suggested by Albin Babu Varghese. 2. The second patch completes the refactoring by converting all remaining read-only checks throughout OCFS2 to use this new helper. Previous-link: https://lore.kernel.org/all/cover.1763337347.git.eraykrdg1@gmail.com/ Ahmet Eray Karadag (2): ocfs2: Add ocfs2_emergency_state helper and apply to setattr ocfs2: Convert remaining read-only checks to ocfs2_emergency_state fs/ocfs2/buffer_head_io.c | 4 ++-- fs/ocfs2/file.c | 23 ++++++++++++++++------- fs/ocfs2/inode.c | 3 +-- fs/ocfs2/move_extents.c | 5 +++-- fs/ocfs2/ocfs2.h | 18 ++++++++++++++++++ fs/ocfs2/resize.c | 8 +++++--- fs/ocfs2/super.c | 2 +- 7 files changed, 46 insertions(+), 17 deletions(-) -- 2.43.0