Skip to content

Commit 4c86114

Browse files
committed
Merge tag 'iomap-6.1-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull iomap updates from Darrick Wong: "It's pretty quiet this time around -- a UAF bugfix and a new tracepoint so we can watch file writeback: - Fix a UAF bug when recording writeback mapping errors - Add a tracepoint so that we can monitor writeback mappings" * tag 'iomap-6.1-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: add a tracepoint for mappings returned by map_blocks iomap: iomap: fix memory corruption when recording errors during writeback
2 parents bc32a63 + adc9c2e commit 4c86114

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
13601360
error = wpc->ops->map_blocks(wpc, inode, pos);
13611361
if (error)
13621362
break;
1363+
trace_iomap_writepage_map(inode, &wpc->iomap);
13631364
if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE))
13641365
continue;
13651366
if (wpc->iomap.type == IOMAP_HOLE)
@@ -1421,7 +1422,7 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
14211422
if (!count)
14221423
folio_end_writeback(folio);
14231424
done:
1424-
mapping_set_error(folio->mapping, error);
1425+
mapping_set_error(inode->i_mapping, error);
14251426
return error;
14261427
}
14271428

fs/iomap/trace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ DEFINE_EVENT(iomap_class, name, \
148148
TP_ARGS(inode, iomap))
149149
DEFINE_IOMAP_EVENT(iomap_iter_dstmap);
150150
DEFINE_IOMAP_EVENT(iomap_iter_srcmap);
151+
DEFINE_IOMAP_EVENT(iomap_writepage_map);
151152

152153
TRACE_EVENT(iomap_iter,
153154
TP_PROTO(struct iomap_iter *iter, const void *ops,

0 commit comments

Comments
 (0)