Skip to contentSkip to conversation

Cleanup explicit check for mandatory locks

PATCH In review Pavel Emelyanov 2 participants 2 messages Sep 17, 2007 – Sep 19, 2007 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 Cleanup explicit check for mandatory locks

The __mandatory_lock(inode) function makes the same check, but makes the code more readable.

Cc Steven Whitehouse <[email protected]>

---

 fs/gfs2/ops_file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/ops_file.c +2 -2
index 94d76ac..28773ca 100644
@@ -535,7 +535,7 @@ static int gfs2_lock(struct file *file, 
 
 	if (!(fl->fl_flags & FL_POSIX))
 		return -ENOLCK;
-	if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if (__mandatory_lock(&ip->i_inode))
 		return -ENOLCK;
 
 	if (sdp->sd_args.ar_localflocks) {
@@ -637,7 +637,7 @@ static int gfs2_flock(struct file *file,
 
 	if (!(fl->fl_flags & FL_FLOCK))
 		return -ENOLCK;
-	if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if (__mandatory_lock(&ip->i_inode))
 		return -ENOLCK;
 
 	if (sdp->sd_args.ar_localflocks)
#1 lore raw
Quoted 4 lines · On Mon, 17 Sep 2007 11:52:08 +0400 Pavel Emelyanov <[email protected]> wrote:

Subject: [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks
Subject: [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks
Subject: [PATCH 4/5][AFS] Cleanup explicit check for mandatory locks
Subject: [PATCH 5/5][NFS] Cleanup explicit check for mandatory locks

Boring administrivial note: all these patches effectively had the same title. Because the text in "[]" is considered to be something which should be discarded when the patch is applied.

This convention is useful because things like sequence numbering, kernel version information, etc are only relevant when you sent the patch and are not relevant when the patches hit the git tree.

Bottom line: please do include the subsystem ideitification as you have tried to do, but please do not place it inside "[]".

As described in the very fine
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt, better Subject:s here would have been

Subject: [PATCH 2/5] GFS2: Cleanup explicit check for mandatory locks
Subject: [PATCH 3/5] 9PFS: Cleanup explicit check for mandatory locks
Subject: [PATCH 4/5] AFS: Cleanup explicit check for mandatory locks
Subject: [PATCH 5/5] NFS: Cleanup explicit check for mandatory locks

Extreme trivia: I don't consider a colon to terminate a sentence, so if I can be bothered I'll convert "Cleanup" there to "cleanup". And I don't consider "cleanup" to be a word, so it becomes "clean up". And I'll usually remvoe the final "." from the end of the subject because it's basically just a waste of space.