On Mon, Mar 27, 2023 at 07:19:47PM +0900, Tetsuo Handa wrote: > I feel worried about > > /* > * Indirect block might be removed by truncate while we were > * reading it. Handling of that case (forget what we've got and > * reread) is taken out of the main path. > */ > if (err == -EAGAIN) > goto changed; > > in get_block()... Look at the caller of find_shared(); there won't be other truncate messing up with the indirect blocks. sysv_truncate() is called by sysv_write_failed() (from ->write_begin()), sysv_setattr() (->setattr(), with ATTR_SIZE) and sysv_evict_inode() (if there's no links left to on-disk inode; it's an ->evict_inode() instance, so we are dropping the last reference to in-core one). The first two have i_mutex held by callers, serializing them against each other, and both have the in-core inode pinned, which gives exclusion with the third one... IOW, sysv_truncate() (as well as its minixfs counterpart) relies upon having serialization wrt other callers of sysv_truncate().