diff options
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index ea27eaa0cfe5..dc99b4776d58 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -192,7 +192,7 @@ setversion_out: | |||
192 | case EXT4_IOC_GROUP_EXTEND: { | 192 | case EXT4_IOC_GROUP_EXTEND: { |
193 | ext4_fsblk_t n_blocks_count; | 193 | ext4_fsblk_t n_blocks_count; |
194 | struct super_block *sb = inode->i_sb; | 194 | struct super_block *sb = inode->i_sb; |
195 | int err; | 195 | int err, err2; |
196 | 196 | ||
197 | if (!capable(CAP_SYS_RESOURCE)) | 197 | if (!capable(CAP_SYS_RESOURCE)) |
198 | return -EPERM; | 198 | return -EPERM; |
@@ -206,8 +206,10 @@ setversion_out: | |||
206 | 206 | ||
207 | err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); | 207 | err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); |
208 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); | 208 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); |
209 | jbd2_journal_flush(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); | 210 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); |
211 | if (err == 0) | ||
212 | err = err2; | ||
211 | mnt_drop_write(filp->f_path.mnt); | 213 | mnt_drop_write(filp->f_path.mnt); |
212 | 214 | ||
213 | return err; | 215 | return err; |
@@ -215,7 +217,7 @@ setversion_out: | |||
215 | case EXT4_IOC_GROUP_ADD: { | 217 | case EXT4_IOC_GROUP_ADD: { |
216 | struct ext4_new_group_data input; | 218 | struct ext4_new_group_data input; |
217 | struct super_block *sb = inode->i_sb; | 219 | struct super_block *sb = inode->i_sb; |
218 | int err; | 220 | int err, err2; |
219 | 221 | ||
220 | if (!capable(CAP_SYS_RESOURCE)) | 222 | if (!capable(CAP_SYS_RESOURCE)) |
221 | return -EPERM; | 223 | return -EPERM; |
@@ -230,8 +232,10 @@ setversion_out: | |||
230 | 232 | ||
231 | err = ext4_group_add(sb, &input); | 233 | err = ext4_group_add(sb, &input); |
232 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); | 234 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); |
233 | jbd2_journal_flush(EXT4_SB(sb)->s_journal); | 235 | err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); |
234 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); | 236 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); |
237 | if (err == 0) | ||
238 | err = err2; | ||
235 | mnt_drop_write(filp->f_path.mnt); | 239 | mnt_drop_write(filp->f_path.mnt); |
236 | 240 | ||
237 | return err; | 241 | return err; |