Skip to contentSkip to conversation

Btrfs: make error return negative in btrfs_sync_file()

PATCH New Roel Kluin 1 participant 1 message Jan 29, 2010 Btrfs file system

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Btrfs: make error return negative in btrfs_sync_file()

It appears the error return should be negative

---
But I fail to see how ret can be positive, unless maybe when we already did a BUG()?

fs/btrfs/file.c +1 -1
index c020335..9d08096 100644
@@ -1133,7 +1133,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
 	}
 	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 = {