aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index c4fa4664a456..73c6d085bd90 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -978,9 +978,11 @@ out_nolock:
978 return num_written ? num_written : err; 978 return num_written ? num_written : err;
979} 979}
980 980
981static int btrfs_release_file (struct inode * inode, struct file * filp) 981int btrfs_release_file(struct inode * inode, struct file * filp)
982{ 982{
983 btrfs_del_ordered_inode(inode); 983 btrfs_del_ordered_inode(inode);
984 if (filp->private_data)
985 btrfs_ioctl_trans_end(filp);
984 return 0; 986 return 0;
985} 987}
986 988
@@ -1011,6 +1013,9 @@ static int btrfs_sync_file(struct file *file,
1011 /* 1013 /*
1012 * ok we haven't committed the transaction yet, lets do a commit 1014 * ok we haven't committed the transaction yet, lets do a commit
1013 */ 1015 */
1016 if (file->private_data)
1017 btrfs_ioctl_trans_end(file);
1018
1014 trans = btrfs_start_transaction(root, 1); 1019 trans = btrfs_start_transaction(root, 1);
1015 if (!trans) { 1020 if (!trans) {
1016 ret = -ENOMEM; 1021 ret = -ENOMEM;