Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ecryptfs-3.8-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs

Pull ecryptfs fixes from Tyler Hicks:
"Two self-explanatory fixes and a third patch which improves
performance: when overwriting a full page in the eCryptfs page cache,
skip reading in and decrypting the corresponding lower page."

* tag 'ecryptfs-3.8-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
fs/ecryptfs/crypto.c: make ecryptfs_encode_for_filename() static
eCryptfs: fix to use list_for_each_entry_safe() when delete items
eCryptfs: Avoid unnecessary disk read and data decryption during writing

+14 -6
+1 -1
fs/ecryptfs/crypto.c
··· 1935 1935 * @src: Source location for the filename to encode 1936 1936 * @src_size: Size of the source in bytes 1937 1937 */ 1938 - void ecryptfs_encode_for_filename(unsigned char *dst, size_t *dst_size, 1938 + static void ecryptfs_encode_for_filename(unsigned char *dst, size_t *dst_size, 1939 1939 unsigned char *src, size_t src_size) 1940 1940 { 1941 1941 size_t num_blocks;
+3 -3
fs/ecryptfs/kthread.c
··· 102 102 103 103 void ecryptfs_destroy_kthread(void) 104 104 { 105 - struct ecryptfs_open_req *req; 105 + struct ecryptfs_open_req *req, *tmp; 106 106 107 107 mutex_lock(&ecryptfs_kthread_ctl.mux); 108 108 ecryptfs_kthread_ctl.flags |= ECRYPTFS_KTHREAD_ZOMBIE; 109 - list_for_each_entry(req, &ecryptfs_kthread_ctl.req_list, 110 - kthread_ctl_list) { 109 + list_for_each_entry_safe(req, tmp, &ecryptfs_kthread_ctl.req_list, 110 + kthread_ctl_list) { 111 111 list_del(&req->kthread_ctl_list); 112 112 *req->lower_file = ERR_PTR(-EIO); 113 113 complete(&req->done);
+10 -2
fs/ecryptfs/mmap.c
··· 338 338 if (prev_page_end_size 339 339 >= i_size_read(page->mapping->host)) { 340 340 zero_user(page, 0, PAGE_CACHE_SIZE); 341 - } else { 341 + SetPageUptodate(page); 342 + } else if (len < PAGE_CACHE_SIZE) { 342 343 rc = ecryptfs_decrypt_page(page); 343 344 if (rc) { 344 345 printk(KERN_ERR "%s: Error decrypting " ··· 349 348 ClearPageUptodate(page); 350 349 goto out; 351 350 } 351 + SetPageUptodate(page); 352 352 } 353 - SetPageUptodate(page); 354 353 } 355 354 } 356 355 /* If creating a page or more of holes, zero them out via truncate. ··· 499 498 ecryptfs_inode_to_lower(ecryptfs_inode)); 500 499 } 501 500 goto out; 501 + } 502 + if (!PageUptodate(page)) { 503 + if (copied < PAGE_CACHE_SIZE) { 504 + rc = 0; 505 + goto out; 506 + } 507 + SetPageUptodate(page); 502 508 } 503 509 /* Fills in zeros if 'to' goes beyond inode size */ 504 510 rc = fill_zeros_to_end_of_page(page, to);