patch-2.3.45 linux/fs/locks.c

Next file: linux/fs/ncpfs/inode.c
Previous file: linux/fs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.44/linux/fs/locks.c linux/fs/locks.c
@@ -416,15 +416,16 @@
 	if (IS_MANDLOCK(inode) &&
 	    (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) {
 		struct vm_area_struct *vma;
-		spin_lock(&inode->i_shared_lock);
-		for(vma = inode->i_mmap;vma;vma = vma->vm_next_share) {
+		struct address_space *mapping = inode->i_mapping;
+		spin_lock(&mapping->i_shared_lock);
+		for(vma = mapping->i_mmap;vma;vma = vma->vm_next_share) {
 			if (!(vma->vm_flags & VM_MAYSHARE))
 				continue;
-			spin_unlock(&inode->i_shared_lock);
+			spin_unlock(&mapping->i_shared_lock);
 			error = -EAGAIN;
 			goto out_putf;
 		}
-		spin_unlock(&inode->i_shared_lock);
+		spin_unlock(&mapping->i_shared_lock);
 	}
 
 	error = -EINVAL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)