[PATCH 0/2] hfs/hfsplus: don't take inode_lock in ->fsync()

From: Viacheslav Dubeyko

Date: Thu Nov 12 2026 - 20:06:13 EST


Both hfs_file_fsync() and hfsplus_file_fsync() take inode_lock()
around the metadata part of fsync. For both file systems
it is not needed: the inode's metadata is written by
the same ->write_inode() path that the flusher threads use
without inode_lock, the b-tree records are updated under the b-tree
locks, and the b-tree, bitmap and MDB/volume header flushes are
per-superblock and serialized by their own locks (mdb_lock in HFS,
vh_mutex/alloc_mutex in HFS+). The lock only holds off writers of the
file for the whole duration of the metadata and device cache flushes.

Drop inode_lock()/inode_unlock() from both ->fsync()
handlers. Patch 1 is for HFS+, patch 2 does the same for HFS.

Viacheslav Dubeyko (2):
hfsplus: don't take inode_lock in hfsplus_file_fsync()
hfs: don't take inode_lock in hfs_file_fsync()

fs/hfs/inode.c | 2 --
fs/hfsplus/inode.c | 3 ---
2 files changed, 5 deletions(-)

--
2.53.0