Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286749
b: refs/heads/master
c: 5e6f0d7
h: refs/heads/master
i:
  286747: e4d8502
v: v3
  • Loading branch information
Tyler Hicks committed Jan 25, 2012
1 parent e33b64e commit b735f57
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 684a3ff7e69acc7c678d1a1394fe9e757993fd34
refs/heads/master: 5e6f0d769017cc49207ef56996e42363ec26c1f0
19 changes: 14 additions & 5 deletions trunk/fs/ecryptfs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
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;
}

if (num_bytes > total_remaining_bytes)
num_bytes = total_remaining_bytes;
if (pos < offset) {
Expand Down Expand Up @@ -193,15 +198,19 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
}
pos += num_bytes;
}
if ((offset + size) > ecryptfs_file_size) {
i_size_write(ecryptfs_inode, (offset + size));
if (pos > ecryptfs_file_size) {
i_size_write(ecryptfs_inode, pos);
if (crypt_stat->flags & ECRYPTFS_ENCRYPTED) {
rc = ecryptfs_write_inode_size_to_metadata(
int rc2;

rc2 = ecryptfs_write_inode_size_to_metadata(
ecryptfs_inode);
if (rc) {
if (rc2) {
printk(KERN_ERR "Problem with "
"ecryptfs_write_inode_size_to_metadata; "
"rc = [%d]\n", rc);
"rc = [%d]\n", rc2);
if (!rc)
rc = rc2;
goto out;
}
}
Expand Down

0 comments on commit b735f57

Please sign in to comment.