]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - fs/btrfs/inode.c
Btrfs: fix wrong return value of btrfs_truncate_page()
[linux-imx.git] / fs / btrfs / inode.c
index bf609581c5d040102a2bd0694150629988b45084..0446cbe8bcaf6e7e17f93cdb5c0dd84e6e2634d7 100644 (file)
@@ -3521,11 +3521,11 @@ int btrfs_truncate_page(struct inode *inode, loff_t from, loff_t len,
        if (ret)
                goto out;
 
-       ret = -ENOMEM;
 again:
        page = find_or_create_page(mapping, index, mask);
        if (!page) {
                btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE);
+               ret = -ENOMEM;
                goto out;
        }
 
@@ -3574,7 +3574,6 @@ again:
                goto out_unlock;
        }
 
-       ret = 0;
        if (offset != PAGE_CACHE_SIZE) {
                if (!len)
                        len = PAGE_CACHE_SIZE - offset;