aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 2da149cfc9ac..67051be7083a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1582,6 +1582,14 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
1582 error = -EINVAL; 1582 error = -EINVAL;
1583 goto bad_swap; 1583 goto bad_swap;
1584 case 2: 1584 case 2:
1585 /* swap partition endianess hack... */
1586 if (swab32(swap_header->info.version) == 1) {
1587 swab32s(&swap_header->info.version);
1588 swab32s(&swap_header->info.last_page);
1589 swab32s(&swap_header->info.nr_badpages);
1590 for (i = 0; i < swap_header->info.nr_badpages; i++)
1591 swab32s(&swap_header->info.badpages[i]);
1592 }
1585 /* Check the swap header's sub-version and the size of 1593 /* Check the swap header's sub-version and the size of
1586 the swap file and bad block lists */ 1594 the swap file and bad block lists */
1587 if (swap_header->info.version != 1) { 1595 if (swap_header->info.version != 1) {