Re: [RFC PATCH 3/4] hugetlbfs: add hugetlbfs_fallocate()
From: Mike Kravetz
Date: Fri Apr 17 2015 - 13:14:30 EST
On 04/17/2015 01:00 AM, Hillf Danton wrote:
+ clear_huge_page(page, addr, pages_per_huge_page(h));
+ __SetPageUptodate(page);
+ error = huge_add_to_page_cache(page, mapping, index);
+ if (error) {
+ put_page(page);
+ /* Keep going if we see an -EEXIST */
+ if (error != -EEXIST)
+ goto out; /* FIXME, need to free? */
+ }
+
+ /*
+ * page_put due to reference from alloc_huge_page()
+ * unlock_page because locked by add_to_page_cache()
+ */
+ put_page(page);
Still needed if EEXIST?
Nope. Good catch.
I'll fix this in the next version.
--
Mike Kravetz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/