mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-23 22:53:35 +00:00
btrfs-progs: fi mkswapfile: fix page count in header
Per user report on https://old.reddit.com/r/btrfs/comments/107fnw1/btrfs_filesystem_mkswapfile_results_in_an/ the swapfile header does not contain the correct number of pages that matches the file size and the activated swapfile is only 1GiB: # btrfs filesystem mkswapfile -s 10g swapfile # swapon swapfile # cat /proc/swaps Filename Type Size Used Priority /swap/swapfile file 1048572 0 -2 A workaround is to run 'mkswap swapfile' before activation. Proper fix is to calculate the number of (fixed size) 4K pages available for the swap. Issue: #568 Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
660d10d3fb
commit
54b90cb6e5