public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] liveupdate: prevent double management of files
@ 2026-03-21 17:58 Pasha Tatashin
  2026-03-21 17:58 ` [PATCH 1/2] " Pasha Tatashin
  2026-03-21 17:58 ` [PATCH 2/2] selftests: liveupdate: add test for double preservation Pasha Tatashin
  0 siblings, 2 replies; 9+ messages in thread
From: Pasha Tatashin @ 2026-03-21 17:58 UTC (permalink / raw)
  To: brauner, linux-kselftest, rppt, jack, shuah, linux-fsdevel, akpm,
	linux-mm, viro, linux-kernel, pasha.tatashin, dmatlack, pratyush,
	skhawaja

Currently, LUO does not prevent the same file from being
preserved or managed by multiple active sessions simultaneously.
This can lead to conflicts and inconsistent state.

This series introduces a mechanism to prevent double management by:
1. Adding an I_LUO_MANAGED flag to the inode's i_state.
2. Updating the LUO core to set/check this flag during preservation
   and restoration.
3. Adding a selftest to verify that double preservation is correctly
   prevented with -EBUSY.

Background:
Because LUO preserves files of absolutely different types: memfd, and
upcoming vfiofd [1], iommufd [2], guestmefd (and possible kvmfd/cpufd).
There is no common private data or guarantee on how to prevent that the
same file is not preserved twice beside using inode or some slower and
expensive method like hashtables.

[1] https://lore.kernel.org/all/20260129212510.967611-1-dmatlack@google.com
[2] https://lore.kernel.org/all/20260203220948.2176157-1-skhawaja@google.com

v1:
- Rename I_LUO_PRESERVED to I_LUO_MANAGED (Pratyush Yadav)
- Set flag in luo_retrieve_file() and clear in luo_file_finish() (Pratyush Yadav)
- Added trailing comma to enum (Jan Kara)
- Added selftests.
RFC:
https://lore.kernel.org/all/20260317023834.487682-1-pasha.tatashin@soleen.com

Pasha Tatashin (2):
  liveupdate: prevent double management of files
  selftests: liveupdate: add test for double preservation

 include/linux/fs.h                            |  5 ++-
 kernel/liveupdate/luo_file.c                  | 27 ++++++++++--
 .../testing/selftests/liveupdate/liveupdate.c | 41 +++++++++++++++++++
 3 files changed, 69 insertions(+), 4 deletions(-)

-- 
2.43.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-25  2:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 17:58 [PATCH 0/2] liveupdate: prevent double management of files Pasha Tatashin
2026-03-21 17:58 ` [PATCH 1/2] " Pasha Tatashin
2026-03-22  1:04   ` Pasha Tatashin
2026-03-23 11:55     ` Christian Brauner
2026-03-23 13:18       ` Pasha Tatashin
2026-03-24  8:51         ` Christian Brauner
2026-03-24 18:40           ` Andrew Morton
2026-03-25  2:43             ` Pasha Tatashin
2026-03-21 17:58 ` [PATCH 2/2] selftests: liveupdate: add test for double preservation Pasha Tatashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox