Merge branches 'release', 'bugzilla-8570', 'bugzilla-9966', 'bugzilla-9998', 'bugzill...
[sfrench/cifs-2.6.git] / mm / swap_state.c
index 65b81c92738f6ee95363d164c688d7784c3361cc..ec42f01a8d02669fb5bd2c73dcffefb5bb619f6c 100644 (file)
@@ -125,6 +125,7 @@ int add_to_swap(struct page * page, gfp_t gfp_mask)
        int err;
 
        BUG_ON(!PageLocked(page));
+       BUG_ON(!PageUptodate(page));
 
        for (;;) {
                entry = get_swap_page();
@@ -147,7 +148,6 @@ int add_to_swap(struct page * page, gfp_t gfp_mask)
 
                switch (err) {
                case 0:                         /* Success */
-                       SetPageUptodate(page);
                        SetPageDirty(page);
                        return 1;
                case -EEXIST: