Thread (53 messages) 53 messages, 8 authors, 2020-11-02

Re: [PATCH 01/34] namespace: take lock_mount_hash() directly when changing flags

From: Christoph Hellwig <hch@infradead.org>
Date: 2020-11-01 14:41:26
Also in: linux-ext4, linux-fsdevel, linux-integrity, linux-security-module, linux-unionfs, selinux

quoted hunk ↗ jump to hunk
index cebaa3e81794..20ee291a7af4 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -463,7 +463,6 @@ static int mnt_make_readonly(struct mount *mnt)
 {
 	int ret = 0;
 
-	lock_mount_hash();
What about adding a lockdep_assert_lock_held in all the functions
that used to take the lock to document the assumptions?
 static int __mnt_unmake_readonly(struct mount *mnt)
 {
-	lock_mount_hash();
 	mnt->mnt.mnt_flags &= ~MNT_READONLY;
-	unlock_mount_hash();
 	return 0;
This helper is rather pointless now.
 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags)
 {
-	lock_mount_hash();
 	mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK;
 	mnt->mnt.mnt_flags = mnt_flags;
 	touch_mnt_namespace(mnt->mnt_ns);
-	unlock_mount_hash();
In linux-next there is an additional notify_mount after the unlock here.

Also while you touch this lock_mount_hash/unlock_mount_hash could be
moved to namespace.c and maked static now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help