Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b7b2eb

Browse files
minchanktorvalds
authored andcommitted
mm: validate inode in mapping_set_error()
The swap address_space doesn't have host. Thus, it makes kernel crash onceswap write meets error. Fix it.Fixes:735e4ae ("vfs: track per-sb writeback errors and report them to syncfs")Signed-off-by: Minchan Kim <minchan@kernel.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Acked-by: Jeff Layton <jlayton@kernel.org>Cc: Jan Kara <jack@suse.cz>Cc: Andres Freund <andres@anarazel.de>Cc: Matthew Wilcox <willy@infradead.org>Cc: Al Viro <viro@zeniv.linux.org.uk>Cc: Christoph Hellwig <hch@infradead.org>Cc: Dave Chinner <david@fromorbit.com>Cc: David Howells <dhowells@redhat.com>Cc: <stable@vger.kernel.org>Link:https://lkml.kernel.org/r/20201010000650.750063-1-minchan@kernel.orgSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parentbc4fe4c commit8b7b2eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎include/linux/pagemap.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static inline void mapping_set_error(struct address_space *mapping, int error)
5454
__filemap_set_wb_err(mapping,error);
5555

5656
/* Record it in superblock */
57-
errseq_set(&mapping->host->i_sb->s_wb_err,error);
57+
if (mapping->host)
58+
errseq_set(&mapping->host->i_sb->s_wb_err,error);
5859

5960
/* Record it in flags for now, for legacy callers */
6061
if (error==-ENOSPC)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp