diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-11-12 16:46:12 -0500 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-11-16 11:45:49 +0100 |
| commit | 7b2438af4d91dcb8fe3de99e55beb06f3c168309 (patch) | |
| tree | 8d3d8811e840e396ba32af44ac33f9613e14aa94 /rust/kernel/alloc | |
| parent | 3b6942b132033cbc3f6566f698709d9038daf7b2 (diff) | |
xfs: refuse writes to files racing with realtime inode flag changes
Zoned writes need to reserve space before taking the iolock to avoid
deadlocks with garbage collection. But this means that the realtime inode
flag which indicates if the file will be placed on the zoned realtime
device or the main data device can be flipped after taking the reservation
and before taking the write, or after deciding to go down the regular
write path, both of which can't work.
Re-sample the realtime flag just before the actual write, and refuse the
write if the flag changed. Do not retry the write using the now correct
path, as switching the flag under a write is not a normal use case, and
trying to flip between the zoned and regular path is an inherent life
lock as it could be switched around again the next time this check is
performed.
Fixes: 058dd70c65ab ("xfs: implement buffered writes to zoned RT devices")
Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
Reported-by: Chris Mason <mason@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
