|
@@ -4537,7 +4537,8 @@ static int ext4_commit_super(struct super_block *sb, int sync)
|
|
&EXT4_SB(sb)->s_freeinodes_counter));
|
|
&EXT4_SB(sb)->s_freeinodes_counter));
|
|
BUFFER_TRACE(sbh, "marking dirty");
|
|
BUFFER_TRACE(sbh, "marking dirty");
|
|
ext4_superblock_csum_set(sb);
|
|
ext4_superblock_csum_set(sb);
|
|
- lock_buffer(sbh);
|
|
|
|
|
|
+ if (sync)
|
|
|
|
+ lock_buffer(sbh);
|
|
if (buffer_write_io_error(sbh)) {
|
|
if (buffer_write_io_error(sbh)) {
|
|
/*
|
|
/*
|
|
* Oh, dear. A previous attempt to write the
|
|
* Oh, dear. A previous attempt to write the
|
|
@@ -4553,8 +4554,8 @@ static int ext4_commit_super(struct super_block *sb, int sync)
|
|
set_buffer_uptodate(sbh);
|
|
set_buffer_uptodate(sbh);
|
|
}
|
|
}
|
|
mark_buffer_dirty(sbh);
|
|
mark_buffer_dirty(sbh);
|
|
- unlock_buffer(sbh);
|
|
|
|
if (sync) {
|
|
if (sync) {
|
|
|
|
+ unlock_buffer(sbh);
|
|
error = __sync_dirty_buffer(sbh,
|
|
error = __sync_dirty_buffer(sbh,
|
|
test_opt(sb, BARRIER) ? WRITE_FUA : WRITE_SYNC);
|
|
test_opt(sb, BARRIER) ? WRITE_FUA : WRITE_SYNC);
|
|
if (error)
|
|
if (error)
|