linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] hugetlbfs: fix hugetlbfs_statfs() locking
@ 2022-04-29 20:22 Mina Almasry
  2022-04-29 20:33 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Mina Almasry @ 2022-04-29 20:22 UTC (permalink / raw)
  To: Mike Kravetz, Oscar Salvador, Andrew Morton, Muchun Song, Michal Hocko
  Cc: Mina Almasry, linux-mm, linux-kernel

After commit db71ef79b59b ("hugetlb: make free_huge_page irq safe"),
the subpool lock should be locked with spin_lock_irq() and all call
sites was modified as such, except for the ones in hugetlbfs_statfs().

Fixes: db71ef79b59b ("hugetlb: make free_huge_page irq safe")
Signed-Off-By: Mina Almasry <almasrymina@google.com>
---
 fs/hugetlbfs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index dd3a088db11d..591599829e2a 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -1048,12 +1048,12 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 		if (sbinfo->spool) {
 			long free_pages;

-			spin_lock(&sbinfo->spool->lock);
+			spin_lock_irq(&sbinfo->spool->lock);
 			buf->f_blocks = sbinfo->spool->max_hpages;
 			free_pages = sbinfo->spool->max_hpages
 				- sbinfo->spool->used_hpages;
 			buf->f_bavail = buf->f_bfree = free_pages;
-			spin_unlock(&sbinfo->spool->lock);
+			spin_unlock_irq(&sbinfo->spool->lock);
 			buf->f_files = sbinfo->max_inodes;
 			buf->f_ffree = sbinfo->free_inodes;
 		}
--
2.36.0.464.gb9c8b46e94-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-02 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 20:22 [PATCH v1] hugetlbfs: fix hugetlbfs_statfs() locking Mina Almasry
2022-04-29 20:33 ` Andrew Morton
2022-04-29 20:59   ` Mike Kravetz
2022-05-02 23:19     ` Mina Almasry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox