diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index f06c275644b7..32d10a617613 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1173,8 +1173,11 @@ out_nolock: | |||
1173 | ret = btrfs_log_dentry_safe(trans, root, | 1173 | ret = btrfs_log_dentry_safe(trans, root, |
1174 | file->f_dentry); | 1174 | file->f_dentry); |
1175 | if (ret == 0) { | 1175 | if (ret == 0) { |
1176 | btrfs_sync_log(trans, root); | 1176 | ret = btrfs_sync_log(trans, root); |
1177 | btrfs_end_transaction(trans, root); | 1177 | if (ret == 0) |
1178 | btrfs_end_transaction(trans, root); | ||
1179 | else | ||
1180 | btrfs_commit_transaction(trans, root); | ||
1178 | } else { | 1181 | } else { |
1179 | btrfs_commit_transaction(trans, root); | 1182 | btrfs_commit_transaction(trans, root); |
1180 | } | 1183 | } |
@@ -1266,8 +1269,11 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
1266 | if (ret > 0) { | 1269 | if (ret > 0) { |
1267 | ret = btrfs_commit_transaction(trans, root); | 1270 | ret = btrfs_commit_transaction(trans, root); |
1268 | } else { | 1271 | } else { |
1269 | btrfs_sync_log(trans, root); | 1272 | ret = btrfs_sync_log(trans, root); |
1270 | ret = btrfs_end_transaction(trans, root); | 1273 | if (ret == 0) |
1274 | ret = btrfs_end_transaction(trans, root); | ||
1275 | else | ||
1276 | ret = btrfs_commit_transaction(trans, root); | ||
1271 | } | 1277 | } |
1272 | mutex_lock(&dentry->d_inode->i_mutex); | 1278 | mutex_lock(&dentry->d_inode->i_mutex); |
1273 | out: | 1279 | out: |