author: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> 2013-06-09 01:25:57 +0200
committer: Linus Torvalds <torvalds@linux-foundation.org> 2013-06-08 17:39:40 -0700
commit: bbd465df73f0d8ba41b8a0732766a243d0f5b356
parent: 81db4dbf592b486ac2bc7cabfb328ee2a6c4725d
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 3027f4dbbab5..e4ba5fe4c3b5 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -109,10 +109,14 @@ static void hpfs_write_failed(struct address_space *mapping, loff_t to)
{
struct inode *inode = mapping->host;
+ hpfs_lock(inode->i_sb);
+
if (to > inode->i_size) {
truncate_pagecache(inode, to, inode->i_size);
hpfs_truncate(inode);
}
+
+ hpfs_unlock(inode->i_sb);
}
static int hpfs_write_begin(struct file *file, struct address_space *mapping,