* [PATCH] ocfs2: Skip check for mandatory locks when unlocking
@ 2010-03-23 8:54 Neil Brown
2010-03-25 14:05 ` Boaz Harrosh
0 siblings, 1 reply; 2+ messages in thread
From: Neil Brown @ 2010-03-23 8:54 UTC (permalink / raw)
To: Mark Fasheh, Joel Becker; +Cc: linux-kernel, Sachin Prabhu
The nfs bug fixed by 0800c5f7a499a8961c3868e95cc4cf1715166457
and the 9p bug fixed by f78233dd44a110c574fe760ad6f9c1e8741a0d00
and the gfs2 bug fixed by 720e7749279bde0d08684b1bb4e7a2eedeec6394
also needs to be fixed for ocfs2. This patch does that.
Hopefully this is the last filesystem with this bug :-)
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c
index 544ac62..923d3d8 100644
--- a/fs/ocfs2/locks.c
+++ b/fs/ocfs2/locks.c
@@ -113,7 +113,8 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl)
if (!(fl->fl_flags & FL_FLOCK))
return -ENOLCK;
- if (__mandatory_lock(inode))
+ if (__mandatory_lock(inode) &&
+ fl->fl_type != F_UNLCK)
return -ENOLCK;
if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) ||
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ocfs2: Skip check for mandatory locks when unlocking
2010-03-23 8:54 [PATCH] ocfs2: Skip check for mandatory locks when unlocking Neil Brown
@ 2010-03-25 14:05 ` Boaz Harrosh
0 siblings, 0 replies; 2+ messages in thread
From: Boaz Harrosh @ 2010-03-25 14:05 UTC (permalink / raw)
To: Neil Brown; +Cc: Mark Fasheh, Joel Becker, linux-kernel, Sachin Prabhu
On 03/23/2010 10:54 AM, Neil Brown wrote:
>
> The nfs bug fixed by 0800c5f7a499a8961c3868e95cc4cf1715166457
> and the 9p bug fixed by f78233dd44a110c574fe760ad6f9c1e8741a0d00
> and the gfs2 bug fixed by 720e7749279bde0d08684b1bb4e7a2eedeec6394
>
> also needs to be fixed for ocfs2. This patch does that.
>
> Hopefully this is the last filesystem with this bug :-)
>
> Signed-off-by: NeilBrown <neilb@suse.de>
> Cc: stable@kernel.org
>
> diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c
> index 544ac62..923d3d8 100644
> --- a/fs/ocfs2/locks.c
> +++ b/fs/ocfs2/locks.c
> @@ -113,7 +113,8 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl)
>
> if (!(fl->fl_flags & FL_FLOCK))
> return -ENOLCK;
> - if (__mandatory_lock(inode))
> + if (__mandatory_lock(inode) &&
> + fl->fl_type != F_UNLCK)
If you reverse the order of these then you'd optimize away
the call to __mandatory_lock(inode). As it is now, it will
call it but then ignore the return if == F_UNLCK.
> return -ENOLCK;
>
> if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) ||
> --
Boaz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-25 14:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23 8:54 [PATCH] ocfs2: Skip check for mandatory locks when unlocking Neil Brown
2010-03-25 14:05 ` Boaz Harrosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox