diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-01-28 13:34:55 +0100 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-05 22:09:10 +0100 |
commit | 0a3404dcff29a7589e8d6ce8c36f97c5411f85b4 (patch) | |
tree | 14531ce5b4c7fe080847590237b6c97b57f69edb /fs | |
parent | Btrfs: do not merge logged extents if we've removed them from the tree (diff) | |
download | linux-0a3404dcff29a7589e8d6ce8c36f97c5411f85b4.tar.xz linux-0a3404dcff29a7589e8d6ce8c36f97c5411f85b4.zip |
Btrfs: fix wrong sync_writers decrement in btrfs_file_aio_write()
If the checks at the beginning of btrfs_file_aio_write() fail, we needn't
decrease ->sync_writers, because we have not increased it. Fix it.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 841cfe3be0e0..a902faab7161 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1595,9 +1595,10 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, if (err < 0 && num_written > 0) num_written = err; } -out: + if (sync) atomic_dec(&BTRFS_I(inode)->sync_writers); +out: sb_end_write(inode->i_sb); current->backing_dev_info = NULL; return num_written ? num_written : err; |