Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93986
b: refs/heads/master
c: 797df57
h: refs/heads/master
v: v3
  • Loading branch information
Chris Dearman authored and Linus Torvalds committed Apr 28, 2008
1 parent 5a76d38 commit 063cd6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19770b32609b6bf97a3dece2529089494cbfc549
refs/heads/master: 797df5749032c2286bc7ff3a52de41fde0cdf0a5
8 changes: 8 additions & 0 deletions trunk/mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,14 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
error = -EINVAL;
goto bad_swap;
case 2:
/* swap partition endianess hack... */
if (swab32(swap_header->info.version) == 1) {
swab32s(&swap_header->info.version);
swab32s(&swap_header->info.last_page);
swab32s(&swap_header->info.nr_badpages);
for (i = 0; i < swap_header->info.nr_badpages; i++)
swab32s(&swap_header->info.badpages[i]);
}
/* Check the swap header's sub-version and the size of
the swap file and bad block lists */
if (swap_header->info.version != 1) {
Expand Down

0 comments on commit 063cd6d

Please sign in to comment.