aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-02-26 15:06:29 -0500
committerSteve French <sfrench@us.ibm.com>2007-02-26 15:06:29 -0500
commitba6a46a03f3c46ed68be551c722161bb37caf095 (patch)
tree86f01e0b3a06e74d4681e0bf9dfbfe36602c53fa /fs
parent3677db10a635a39f63ea509f8f0056d95589ff90 (diff)
[CIFS] small piece missing from previous patch
There were two i_size_writes in the new truncate function - we missed one in the last patch. Noticed by Shaggy when he reviewed. Thank you Shaggy ... CC: Shaggy <shaggy@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/inode.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 24df13a256e5..03ade0f972b4 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1139,15 +1139,17 @@ int cifs_vmtruncate(struct inode * inode, loff_t offset)
1139 struct address_space *mapping = inode->i_mapping; 1139 struct address_space *mapping = inode->i_mapping;
1140 unsigned long limit; 1140 unsigned long limit;
1141 1141
1142 spin_lock(&inode->i_lock);
1142 if (inode->i_size < offset) 1143 if (inode->i_size < offset)
1143 goto do_expand; 1144 goto do_expand;
1144 /* 1145 /*
1145 * truncation of in-use swapfiles is disallowed - it would cause 1146 * truncation of in-use swapfiles is disallowed - it would cause
1146 * subsequent swapout to scribble on the now-freed blocks. 1147 * subsequent swapout to scribble on the now-freed blocks.
1147 */ 1148 */
1148 if (IS_SWAPFILE(inode)) 1149 if (IS_SWAPFILE(inode)) {
1150 spin_unlock(&inode->i_lock);
1149 goto out_busy; 1151 goto out_busy;
1150 spin_lock(&inode->i_lock); 1152 }
1151 i_size_write(inode, offset); 1153 i_size_write(inode, offset);
1152 spin_unlock(&inode->i_lock); 1154 spin_unlock(&inode->i_lock);
1153 unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1); 1155 unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
@@ -1156,12 +1158,16 @@ int cifs_vmtruncate(struct inode * inode, loff_t offset)
1156 1158
1157do_expand: 1159do_expand:
1158 limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; 1160 limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
1159 if (limit != RLIM_INFINITY && offset > limit) 1161 if (limit != RLIM_INFINITY && offset > limit) {
1162 spin_unlock(&inode->i_lock);
1160 goto out_sig; 1163 goto out_sig;
1161 if (offset > inode->i_sb->s_maxbytes) 1164 }
1165 if (offset > inode->i_sb->s_maxbytes) {
1166 spin_unlock(&inode->i_lock);
1162 goto out_big; 1167 goto out_big;
1168 }
1163 i_size_write(inode, offset); 1169 i_size_write(inode, offset);
1164 1170 spin_unlock(&inode->i_lock);
1165out_truncate: 1171out_truncate:
1166 if (inode->i_op && inode->i_op->truncate) 1172 if (inode->i_op && inode->i_op->truncate)
1167 inode->i_op->truncate(inode); 1173 inode->i_op->truncate(inode);