aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-08-05 18:55:03 -0400
committerJames Morris <jmorris@namei.org>2009-08-05 18:55:03 -0400
commit012a5299a29672039f42944a37984558393ef769 (patch)
treede0815c67cf4156c32c8b552cd7448387cc391b0 /fs/ext4/ioctl.c
parentda34d4248bd2013ee64ce51e63ec0ebd1f32b46c (diff)
parent90bc1a658a53f8832ee799685703977a450e5af9 (diff)
Merge branch 'master' into next
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r--fs/ext4/ioctl.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 24a6abb2aef5..7050a9cd04a4 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -191,7 +191,7 @@ setversion_out:
191 case EXT4_IOC_GROUP_EXTEND: { 191 case EXT4_IOC_GROUP_EXTEND: {
192 ext4_fsblk_t n_blocks_count; 192 ext4_fsblk_t n_blocks_count;
193 struct super_block *sb = inode->i_sb; 193 struct super_block *sb = inode->i_sb;
194 int err, err2; 194 int err, err2=0;
195 195
196 if (!capable(CAP_SYS_RESOURCE)) 196 if (!capable(CAP_SYS_RESOURCE))
197 return -EPERM; 197 return -EPERM;
@@ -204,9 +204,11 @@ setversion_out:
204 return err; 204 return err;
205 205
206 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); 206 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count);
207 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 207 if (EXT4_SB(sb)->s_journal) {
208 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 208 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
209 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 209 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
210 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
211 }
210 if (err == 0) 212 if (err == 0)
211 err = err2; 213 err = err2;
212 mnt_drop_write(filp->f_path.mnt); 214 mnt_drop_write(filp->f_path.mnt);
@@ -251,7 +253,7 @@ setversion_out:
251 case EXT4_IOC_GROUP_ADD: { 253 case EXT4_IOC_GROUP_ADD: {
252 struct ext4_new_group_data input; 254 struct ext4_new_group_data input;
253 struct super_block *sb = inode->i_sb; 255 struct super_block *sb = inode->i_sb;
254 int err, err2; 256 int err, err2=0;
255 257
256 if (!capable(CAP_SYS_RESOURCE)) 258 if (!capable(CAP_SYS_RESOURCE))
257 return -EPERM; 259 return -EPERM;
@@ -265,9 +267,11 @@ setversion_out:
265 return err; 267 return err;
266 268
267 err = ext4_group_add(sb, &input); 269 err = ext4_group_add(sb, &input);
268 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 270 if (EXT4_SB(sb)->s_journal) {
269 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 271 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
270 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 272 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
273 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
274 }
271 if (err == 0) 275 if (err == 0)
272 err = err2; 276 err = err2;
273 mnt_drop_write(filp->f_path.mnt); 277 mnt_drop_write(filp->f_path.mnt);