]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/gfs2/ops_file.c
GFS2: Clean up of glops.c
[mirror_ubuntu-bionic-kernel.git] / fs / gfs2 / ops_file.c
index 99d726f1c7a612d3025cd318f46572344d468047..48ec3d5e29eb8727a9cd2d14893cee271af54e49 100644 (file)
@@ -355,7 +355,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
        if (ret)
                goto out;
 
-       set_bit(GIF_SW_PAGED, &ip->i_flags);
        ret = gfs2_write_alloc_required(ip, pos, PAGE_CACHE_SIZE, &alloc_required);
        if (ret || !alloc_required)
                goto out_unlock;
@@ -396,6 +395,8 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
                        goto out_unlock_page;
        }
        ret = gfs2_allocate_page_backing(page);
+       if (!ret)
+               set_bit(GIF_SW_PAGED, &ip->i_flags);
 
 out_unlock_page:
        unlock_page(page);