Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Feb 2010 15:23:03 +0000 (07:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Feb 2010 15:23:03 +0000 (07:23 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: apply updated fallocate i_size fix
  Btrfs: do not try and lookup the file extent when finishing ordered io
  Btrfs: Fix oopsen when dropping empty tree.
  Btrfs: remove BUG_ON() due to mounting bad filesystem
  Btrfs: make error return negative in btrfs_sync_file()
  Btrfs: fix race between allocate and release extent buffer.

1  2 
fs/btrfs/file.c

diff --combined fs/btrfs/file.c
@@@ -832,7 -832,7 +832,7 @@@ static ssize_t btrfs_file_write(struct 
        unsigned long last_index;
        int will_write;
  
 -      will_write = ((file->f_flags & O_SYNC) || IS_SYNC(inode) ||
 +      will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) ||
                      (file->f_flags & O_DIRECT));
  
        nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE,
@@@ -999,7 -999,7 +999,7 @@@ out_nolock
                if (err)
                        num_written = err;
  
 -              if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) {
 +              if ((file->f_flags & O_DSYNC) || IS_SYNC(inode)) {
                        trans = btrfs_start_transaction(root, 1);
                        ret = btrfs_log_dentry_safe(trans, root,
                                                    file->f_dentry);
@@@ -1133,7 -1133,7 +1133,7 @@@ int btrfs_sync_file(struct file *file, 
        }
        mutex_lock(&dentry->d_inode->i_mutex);
  out:
-       return ret > 0 ? EIO : ret;
+       return ret > 0 ? -EIO : ret;
  }
  
  static const struct vm_operations_struct btrfs_file_vm_ops = {