aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/ntfs3/file.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fs/ntfs3/file.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index b73969e05052..2f903b6ce157 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -578,6 +578,15 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
/* Check new size. */
u8 cluster_bits = sbi->cluster_bits;
+ /* Be sure file is non resident. */
+ if (is_resident(ni)) {
+ ni_lock(ni);
+ err = attr_force_nonresident(ni);
+ ni_unlock(ni);
+ if (err)
+ goto out;
+ }
+
/* generic/213: expected -ENOSPC instead of -EFBIG. */
if (!is_supported_holes) {
loff_t to_alloc = new_size - inode_get_bytes(inode);