diff options
Diffstat (limited to 'fs/crypto/bio.c')
-rw-r--r-- | fs/crypto/bio.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 5759bcd018cd..b46021ebde85 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -29,20 +29,17 @@ static void __fscrypt_decrypt_bio(struct bio *bio, bool done) { struct bio_vec *bv; - int i; struct bvec_iter_all iter_all; - bio_for_each_segment_all(bv, bio, i, iter_all) { + bio_for_each_segment_all(bv, bio, iter_all) { struct page *page = bv->bv_page; int ret = fscrypt_decrypt_page(page->mapping->host, page, PAGE_SIZE, 0, page->index); - if (ret) { - WARN_ON_ONCE(1); + if (ret) SetPageError(page); - } else if (done) { + else if (done) SetPageUptodate(page); - } if (done) unlock_page(page); } @@ -104,7 +101,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, BUG_ON(inode->i_sb->s_blocksize != PAGE_SIZE); - ctx = fscrypt_get_ctx(inode, GFP_NOFS); + ctx = fscrypt_get_ctx(GFP_NOFS); if (IS_ERR(ctx)) return PTR_ERR(ctx); |