--- zzzz-none-000/linux-2.6.32.61/fs/ecryptfs/read_write.c 2013-06-10 09:43:48.000000000 +0000 +++ ar10-7272-687/linux-2.6.32.61/fs/ecryptfs/read_write.c 2010-04-08 11:00:21.000000000 +0000 @@ -134,18 +134,13 @@ pgoff_t ecryptfs_page_idx = (pos >> PAGE_CACHE_SHIFT); size_t start_offset_in_page = (pos & ~PAGE_CACHE_MASK); size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page); - loff_t total_remaining_bytes = ((offset + size) - pos); - - if (fatal_signal_pending(current)) { - rc = -EINTR; - break; - } + size_t total_remaining_bytes = ((offset + size) - pos); if (num_bytes > total_remaining_bytes) num_bytes = total_remaining_bytes; if (pos < offset) { /* remaining zeros to write, up to destination offset */ - loff_t total_remaining_zeros = (offset - pos); + size_t total_remaining_zeros = (offset - pos); if (num_bytes > total_remaining_zeros) num_bytes = total_remaining_zeros; @@ -202,19 +197,15 @@ } pos += num_bytes; } - if (pos > ecryptfs_file_size) { - i_size_write(ecryptfs_inode, pos); + if ((offset + size) > ecryptfs_file_size) { + i_size_write(ecryptfs_inode, (offset + size)); if (crypt_stat->flags & ECRYPTFS_ENCRYPTED) { - int rc2; - - rc2 = ecryptfs_write_inode_size_to_metadata( + rc = ecryptfs_write_inode_size_to_metadata( ecryptfs_inode); - if (rc2) { + if (rc) { printk(KERN_ERR "Problem with " "ecryptfs_write_inode_size_to_metadata; " - "rc = [%d]\n", rc2); - if (!rc) - rc = rc2; + "rc = [%d]\n", rc); goto out; } }