This is a note to let you know that I've just added the patch titled

    btrfs: fix wrong accounting of raid1 data profile in statfs

to the 3.18-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     btrfs-fix-wrong-accounting-of-raid1-data-profile-in-statfs.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 0d95c1bec906dd1ad951c9c001e798ca52baeb0f Mon Sep 17 00:00:00 2001
From: David Sterba <[email protected]>
Date: Fri, 14 Nov 2014 15:05:06 +0100
Subject: btrfs: fix wrong accounting of raid1 data profile in statfs

From: David Sterba <[email protected]>

commit 0d95c1bec906dd1ad951c9c001e798ca52baeb0f upstream.

The sizes that are obtained from space infos are in raw units and have
to be adjusted according to the raid factor. This was missing for
f_bavail and df reported doubled size for raid1.

Reported-by: Martin Steigerwald <[email protected]>
Fixes: ba7b6e62f420 ("btrfs: adjust statfs calculations according to raid 
profiles")
Signed-off-by: David Sterba <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/btrfs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1824,7 +1824,7 @@ static int btrfs_statfs(struct dentry *d
        buf->f_bfree -= block_rsv->size >> bits;
        spin_unlock(&block_rsv->lock);
 
-       buf->f_bavail = total_free_data;
+       buf->f_bavail = div_u64(total_free_data, factor);
        ret = btrfs_calc_avail_data_space(fs_info->tree_root, &total_free_data);
        if (ret) {
                mutex_unlock(&fs_info->chunk_mutex);


Patches currently in stable-queue which might be from [email protected] are

queue-3.18/btrfs-fix-wrong-accounting-of-raid1-data-profile-in-statfs.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to