summaryrefslogtreecommitdiff
path: root/.rustfmt.toml
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-09-04 12:41:08 -0700
committerAndrew Morton <akpm@linux-foundation.org>2024-09-26 14:01:44 -0700
commitdc677b5f3765cfd0944c8873d1ea57f1a3439676 (patch)
tree0984ef6b9be54e5b182541a7a7cd97e21453e4c6 /.rustfmt.toml
parentce645b9fdc78ec5d28067286e92871ddae6817d5 (diff)
downloadlinux-dc677b5f3765cfd0944c8873d1ea57f1a3439676.tar.gz
linux-dc677b5f3765cfd0944c8873d1ea57f1a3439676.tar.bz2
linux-dc677b5f3765cfd0944c8873d1ea57f1a3439676.zip
mm/hugetlb: simplify refs in memfd_alloc_folio
The folio_try_get in memfd_alloc_folio is not necessary. Delete it, and delete the matching folio_put in memfd_pin_folios. This also avoids leaking a ref if the memfd_alloc_folio call to hugetlb_add_to_page_cache fails. That error path is also broken in a second way -- when its folio_put causes the ref to become 0, it will implicitly call free_huge_folio, but then the path *explicitly* calls free_huge_folio. Delete the latter. This is a continuation of the fix "mm/hugetlb: fix memfd_pin_folios free_huge_pages leak" [steven.sistare@oracle.com: remove explicit call to free_huge_folio(), per Matthew] Link: https://lkml.kernel.org/r/Zti-7nPVMcGgpcbi@casper.infradead.org Link: https://lkml.kernel.org/r/1725481920-82506-1-git-send-email-steven.sistare@oracle.com Link: https://lkml.kernel.org/r/1725478868-61732-1-git-send-email-steven.sistare@oracle.com Fixes: 89c1905d9c14 ("mm/gup: introduce memfd_pin_folios() for pinning memfd folios") Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Suggested-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Cc: David Hildenbrand <david@redhat.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Peter Xu <peterx@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '.rustfmt.toml')
0 files changed, 0 insertions, 0 deletions