aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/swapfile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 61a604c12a96..4dade515b086 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1975,8 +1975,6 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
1975 if (unlikely(error)) 1975 if (unlikely(error))
1976 goto bad_swap; 1976 goto bad_swap;
1977 1977
1978 swapfilepages = i_size_read(inode) >> PAGE_SHIFT;
1979
1980 /* 1978 /*
1981 * Read the swap header. 1979 * Read the swap header.
1982 */ 1980 */
@@ -2045,6 +2043,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
2045 error = -EINVAL; 2043 error = -EINVAL;
2046 if (!maxpages) 2044 if (!maxpages)
2047 goto bad_swap; 2045 goto bad_swap;
2046 swapfilepages = i_size_read(inode) >> PAGE_SHIFT;
2048 if (swapfilepages && maxpages > swapfilepages) { 2047 if (swapfilepages && maxpages > swapfilepages) {
2049 printk(KERN_WARNING 2048 printk(KERN_WARNING
2050 "Swap area shorter than signature indicates\n"); 2049 "Swap area shorter than signature indicates\n");