[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180212094347.22071-2-chandan@linux.vnet.ibm.com>
Date: Mon, 12 Feb 2018 15:13:37 +0530
From: Chandan Rajendra <chandan@...ux.vnet.ibm.com>
To: linux-ext4@...r.kernel.org
Cc: Chandan Rajendra <chandan@...ux.vnet.ibm.com>,
linux-fsdevel@...r.kernel.org, ebiggers3@...il.com,
linux-fscrypt@...r.kernel.org, tytso@....edu
Subject: [RFC PATCH V2 01/11] ext4: Clear BH_Uptodate flag on decryption error
On an error return from fscrypt_decrypt_page(), ext4_block_write_begin()
can return with the page's buffer_head marked with BH_Uptodate
flag. This commit clears the BH_Uptodate flag in such cases.
Signed-off-by: Chandan Rajendra <chandan@...ux.vnet.ibm.com>
---
fs/ext4/inode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 6f6589e..e8ecf67 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1231,9 +1231,13 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
}
if (unlikely(err))
page_zero_new_buffers(page, from, to);
- else if (decrypt)
+ else if (decrypt) {
err = fscrypt_decrypt_page(page->mapping->host, page,
PAGE_SIZE, 0, page->index);
+ if (err)
+ clear_buffer_uptodate(*wait_bh);
+ }
+
return err;
}
#endif
--
2.9.5
Powered by blists - more mailing lists