All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Propagate CRAMFS uncompression errors
@ 2009-02-07  2:55 David VomLehn (dvomlehn)
  2009-02-09 23:16 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: David VomLehn (dvomlehn) @ 2009-02-07  2:55 UTC (permalink / raw)
  To: linux-kernel

If cramfs_uncompress_block detects an error uncompressing it will
return a zero value. This patch checks the return value and propagates
the error back up to the block layer.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
---
 fs/cramfs/inode.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index a07338d..6ff8a5e 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -493,7 +493,15 @@ static int cramfs_readpage(struct file *file,
struct page * page)
 	memset(pgdata + bytes_filled, 0, PAGE_CACHE_SIZE -
bytes_filled);
 	kunmap(page);
 	flush_dcache_page(page);
-	SetPageUptodate(page);
+
+	if (bytes_filled == 0) {
+		ClearPageUptodate(page);
+		SetPageError(page);
+	}
+
+	else
+		SetPageUptodate(page);
+
 	unlock_page(page);
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-10  5:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-07  2:55 [PATCH] Propagate CRAMFS uncompression errors David VomLehn (dvomlehn)
2009-02-09 23:16 ` Andrew Morton
2009-02-10  3:28   ` David VomLehn (dvomlehn)
2009-02-10  3:48     ` Andrew Morton
2009-02-10  4:06       ` David VomLehn
2009-02-10  5:10         ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.