Bug 114281
Summary: | df returns 100% used for empty mixed block group filesystem | ||
---|---|---|---|
Product: | File System | Reporter: | Chris Murphy (bugzilla) |
Component: | btrfs | Assignee: | David Sterba (dsterba) |
Status: | RESOLVED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | CC: | dsterba, luis, szg00000 |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.5.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
patch to fix the issue that made df return 0 available space
Patch for a related issue in the same code. Protect f_bfree from a potential overflow. |
Description
Chris Murphy
2016-03-10 08:22:25 UTC
Interestingly, once written to, it seems to become normal. Identical data written to the two volumes, and now: Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop1 6817792 4102028 2505092 63% /mnt/b1 /dev/loop2 6817792 4167048 2727548 61% /mnt/b2 This looks interesting, and a safe place for a new comer to experiment without breaking the file system. I am planning to look into it. No promises. Will report soon on my progress. I just reproduced this bug with Linux 4.4.6 (latest stable release). It isn't a regression introduced lately in the development repo. Going to try slightly older stable releases to see when the regression was introduced. Tried the empty mixed block group "-M" filesystem in a few more kernel versions. Bug happens in 4.4.6 but not in 4.4. This gives me a hint on when the regression was introduced. Now I can start looking into the code and why it is missbehaving. Will report again after the Easter weekend. The offending patch is known and has been backported to stable kernels, it was introduced in 4.5 cycle. ca8a51b3a979d57b082b14eda38602b7f52d81d1 btrfs: statfs: report zero available if metadata are exhausted Ah! that is even more information to know what is going on in btrfs/super.c:btrfs_statfs() Thanks David for that information :) Getting closer to a fix. Will report back on Monday/Tuesday. Have a good Easter. Created attachment 211091 [details] patch to fix the issue that made df return 0 available space Not sure if I should submit patches here directly or to the linux-btrfs@vger.kernel.org mailing list. Please let me know if I should submit them there in the future. Created attachment 211101 [details]
Patch for a related issue in the same code. Protect f_bfree from a potential overflow.
A patch attached for preview is ok, but please submit it to the mailinglist (with changelog and signed-off-by). Thanks David. Sent to the mailing list. I looked at previous closed bugs in here (bugzilla) and it wasn't clear to me since some had patches attached. Now I know for the future. Hi, Just as a heads up (or a reminder if you saw it already). I have sent the patch to fix this issue [0] and a second one to fix some related code [1]. They are waiting for review whenever you have time. Thank you :) [0] https://lkml.org/lkml/2016/3/30/768 [1] https://lkml.org/lkml/2016/3/30/809 Nevermind! I just realized the two patches have been merged into David's for-next branch. \o/ https://git.kernel.org/cgit/linux/kernel/git/kdave/linux.git/commit/?h=for-next&id=0e0998461def618b80beff44186e04097231c993 https://git.kernel.org/cgit/linux/kernel/git/kdave/linux.git/commit/?h=for-next&id=08cb1c628e9fa631754ba4de12cf433b6f65d805 This bug can be closed now. Thank you David I have tested the patches and scheduled for next dev cycle. Thanks and closing. |