The patch titled reiser4: fix readpage_cryptcompress has been added to the -mm tree. Its filename is reiser4-fix-readpage_cryptcompress.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: reiser4: fix readpage_cryptcompress From: Edward Shishkin <edward@xxxxxxxxxxx> . Fixed oops when readpage_ctail() returns error (trying to unlock non-locked page) . Print inode and number of corrupted disk cluster. Signed-off-by: Edward Shishkin <edward@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/reiser4/plugin/file/cryptcompress.c | 19 +++++++++++++------ fs/reiser4/plugin/item/ctail.c | 5 ++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff -puN fs/reiser4/plugin/file/cryptcompress.c~reiser4-fix-readpage_cryptcompress fs/reiser4/plugin/file/cryptcompress.c --- a/fs/reiser4/plugin/file/cryptcompress.c~reiser4-fix-readpage_cryptcompress +++ a/fs/reiser4/plugin/file/cryptcompress.c @@ -1161,8 +1161,13 @@ int reiser4_inflate_cluster(reiser4_clus if (need_inflate(clust, inode, need_cipher(inode)) && coplug->checksum != NULL) { result = dc_check_checksum(coplug, tc); - if (result) + if (unlikely(result)) { + warning("edward-1460", + "Inode %llu: disk cluster %lu looks corrupted", + (unsigned long long)get_inode_oid(inode), + clust->index); return RETERR(-EIO); + } } if (need_cipher(inode)) { cipher_plugin * ciplug; @@ -1233,8 +1238,10 @@ int readpage_cryptcompress(struct file * assert("edward-89", page->mapping && page->mapping->host); ctx = reiser4_init_context(page->mapping->host->i_sb); - if (IS_ERR(ctx)) + if (IS_ERR(ctx)) { + unlock_page(page); return PTR_ERR(ctx); + } result = check_cryptcompress(page->mapping->host); if (result) { unlock_page(page); @@ -1247,6 +1254,7 @@ int readpage_cryptcompress(struct file * if (PageUptodate(page)) { warning("edward-1338", "page is already uptodate\n"); + unlock_page(page); reiser4_exit_context(ctx); return 0; } @@ -1260,10 +1268,9 @@ int readpage_cryptcompress(struct file * return -EINVAL; } result = iplug->s.file.readpage(&clust, page); - if (result) - unlock_page(page); - assert("edward-64", - ergo(result == 0, (PageLocked(page) || PageUptodate(page)))); + + assert("edward-1459", !PageLocked(page)); + assert("edward-64", ergo(result == 0, PageUptodate(page))); put_cluster_handle(&clust); reiser4_exit_context(ctx); return result; diff -puN fs/reiser4/plugin/item/ctail.c~reiser4-fix-readpage_cryptcompress fs/reiser4/plugin/item/ctail.c --- a/fs/reiser4/plugin/item/ctail.c~reiser4-fix-readpage_cryptcompress +++ a/fs/reiser4/plugin/item/ctail.c @@ -671,12 +671,15 @@ int readpage_ctail(void *vp, struct page assert("edward-867", !tfm_cluster_is_uptodate(&clust->tc)); hint = kmalloc(sizeof(*hint), reiser4_ctx_gfp_mask_get()); - if (hint == NULL) + if (hint == NULL) { + unlock_page(page); return RETERR(-ENOMEM); + } clust->hint = hint; result = load_file_hint(clust->file, hint); if (result) { kfree(hint); + unlock_page(page); return result; } assert("vs-25", hint->ext_coord.lh == &hint->lh); _ Patches currently in -mm which might be from edward@xxxxxxxxxxx are reiser4-vs-streamline-generic_file_-interfaces-and-filemap-fix.patch reiser4-rename-generic_sounding_globalspatch.patch reiser4-use-generic-file-read-fix-readpages-unix-file.patch reiser4-format-subversion-numbers-heir-set-and-file-conversion.patch reiser4-format-subversion-numbers-heir-set-and-file-conversion-fix-readpages-cryptcompress.patch reiser4-cleanups-in-lzo-compression-library.patch reiser4-get-rid-of-deprecated-crypto-api.patch reiser4-get-rid-of-deprecated-crypto-api-build-fix.patch reiser4-fix-missed-unlock-and-exit_context.patch reiser4-use-list_head-instead-of-struct-blocknr.patch reiser4-use-list_empty-instead-of-list_empty_careful-for.patch reiser4-update-comments-fix-write-and-truncate-cryptcompress.patch reiser4-temp-fix.patch reiser4-fix-write_extent-1.patch fs-reiser4-possible-cleanups-2.patch fs-reiser4-more-possible-cleanups.patch reiser4-use-null-for-pointers.patch reiser4-test_clear_page_dirty.patch reiser4-fix-readpage_cryptcompress.patch reiser4-improve-estimation-for-number-of-nodes-occupied.patch reiser4-drop-check_cryptcompress.patch reiser4-vs-git-block.patch reiser4-vs-git-block-2.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html