Skip to content

Commit d15b00b

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
jffs2: Remove calls to set/clear the folio error flag
Nobody checks the error flag on jffs2 folios, so stop setting and clearing it. We can also remove the call to clear the uptodate flag; it will already be clear. Convert one of these into a call to mapping_set_error() which will actually be checked by other parts of the kernel. Cc: David Woodhouse <[email protected]> Cc: [email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Zhihao Cheng <[email protected]> Acked-by: Richard Weinberger <[email protected]> Reviewed-by: Zhihao Cheng <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent e3ec0fe commit d15b00b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

fs/jffs2/file.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,8 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
9595
ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_SHIFT,
9696
PAGE_SIZE);
9797

98-
if (ret) {
99-
ClearPageUptodate(pg);
100-
SetPageError(pg);
101-
} else {
98+
if (!ret)
10299
SetPageUptodate(pg);
103-
ClearPageError(pg);
104-
}
105100

106101
flush_dcache_page(pg);
107102
kunmap(pg);
@@ -304,10 +299,8 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
304299

305300
kunmap(pg);
306301

307-
if (ret) {
308-
/* There was an error writing. */
309-
SetPageError(pg);
310-
}
302+
if (ret)
303+
mapping_set_error(mapping, ret);
311304

312305
/* Adjust writtenlen for the padding we did, so we don't confuse our caller */
313306
writtenlen -= min(writtenlen, (start - aligned_start));
@@ -330,7 +323,6 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
330323
it gets reread */
331324
jffs2_dbg(1, "%s(): Not all bytes written. Marking page !uptodate\n",
332325
__func__);
333-
SetPageError(pg);
334326
ClearPageUptodate(pg);
335327
}
336328

0 commit comments

Comments
 (0)