diff options
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r-- | fs/fat/file.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index 20813d2c7d61..b2eedcee7516 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -387,21 +387,6 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr) | |||
387 | unsigned int ia_valid; | 387 | unsigned int ia_valid; |
388 | int error; | 388 | int error; |
389 | 389 | ||
390 | /* | ||
391 | * Expand the file. Since inode_setattr() updates ->i_size | ||
392 | * before calling the ->truncate(), but FAT needs to fill the | ||
393 | * hole before it. XXX: this is no longer true with new truncate | ||
394 | * sequence. | ||
395 | */ | ||
396 | if (attr->ia_valid & ATTR_SIZE) { | ||
397 | if (attr->ia_size > inode->i_size) { | ||
398 | error = fat_cont_expand(inode, attr->ia_size); | ||
399 | if (error || attr->ia_valid == ATTR_SIZE) | ||
400 | goto out; | ||
401 | attr->ia_valid &= ~ATTR_SIZE; | ||
402 | } | ||
403 | } | ||
404 | |||
405 | /* Check for setting the inode time. */ | 390 | /* Check for setting the inode time. */ |
406 | ia_valid = attr->ia_valid; | 391 | ia_valid = attr->ia_valid; |
407 | if (ia_valid & TIMES_SET_FLAGS) { | 392 | if (ia_valid & TIMES_SET_FLAGS) { |
@@ -417,6 +402,21 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr) | |||
417 | goto out; | 402 | goto out; |
418 | } | 403 | } |
419 | 404 | ||
405 | /* | ||
406 | * Expand the file. Since inode_setattr() updates ->i_size | ||
407 | * before calling the ->truncate(), but FAT needs to fill the | ||
408 | * hole before it. XXX: this is no longer true with new truncate | ||
409 | * sequence. | ||
410 | */ | ||
411 | if (attr->ia_valid & ATTR_SIZE) { | ||
412 | if (attr->ia_size > inode->i_size) { | ||
413 | error = fat_cont_expand(inode, attr->ia_size); | ||
414 | if (error || attr->ia_valid == ATTR_SIZE) | ||
415 | goto out; | ||
416 | attr->ia_valid &= ~ATTR_SIZE; | ||
417 | } | ||
418 | } | ||
419 | |||
420 | if (((attr->ia_valid & ATTR_UID) && | 420 | if (((attr->ia_valid & ATTR_UID) && |
421 | (attr->ia_uid != sbi->options.fs_uid)) || | 421 | (attr->ia_uid != sbi->options.fs_uid)) || |
422 | ((attr->ia_valid & ATTR_GID) && | 422 | ((attr->ia_valid & ATTR_GID) && |