cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: Allow flocks to use normal glock dq rather than dq_wait
       [not found] <1660832679.3803950.1403793568127.JavaMail.zimbra@redhat.com>
@ 2014-06-26 14:46 ` Bob Peterson
  2014-06-26 16:43   ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2014-06-26 14:46 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

This patch allows flock glocks to use a non-blocking dequeue rather
than dq_wait. It also reverts the previous patch I had posted regarding
dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
this might avoid unforeseen side effects, and was therefore safer.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
---
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 0740a57..26b3f95 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
 			goto out;
 		flock_lock_file_wait(file,
 				     &(struct file_lock){.fl_type = F_UNLCK});
-		gfs2_glock_dq_wait(fl_gh);
+		gfs2_glock_dq(fl_gh);
 		gfs2_holder_reinit(state, flags, fl_gh);
 	} else {
 		error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr,
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b703dcc..ee4e04f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
 	struct gfs2_glock *gl = gh->gh_gl;
 	gfs2_glock_dq(gh);
 	might_sleep();
-	if (!find_first_holder(gl))
-		wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
-			    TASK_UNINTERRUPTIBLE);
+	wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
 }
 
 /**



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

* [Cluster-devel] [GFS2 PATCH] GFS2: Allow flocks to use normal glock dq rather than dq_wait
  2014-06-26 14:46 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allow flocks to use normal glock dq rather than dq_wait Bob Peterson
@ 2014-06-26 16:43   ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2014-06-26 16:43 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Both patches are now in the -nmw tree. Thanks,

Steve.

On Thu, 2014-06-26 at 10:46 -0400, Bob Peterson wrote:
> Hi,
> 
> This patch allows flock glocks to use a non-blocking dequeue rather
> than dq_wait. It also reverts the previous patch I had posted regarding
> dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
> this might avoid unforeseen side effects, and was therefore safer.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> ---
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 0740a57..26b3f95 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
>  			goto out;
>  		flock_lock_file_wait(file,
>  				     &(struct file_lock){.fl_type = F_UNLCK});
> -		gfs2_glock_dq_wait(fl_gh);
> +		gfs2_glock_dq(fl_gh);
>  		gfs2_holder_reinit(state, flags, fl_gh);
>  	} else {
>  		error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr,
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index b703dcc..ee4e04f 100644
> --- a/fs/gfs2/glock.c
> +++ b/fs/gfs2/glock.c
> @@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
>  	struct gfs2_glock *gl = gh->gh_gl;
>  	gfs2_glock_dq(gh);
>  	might_sleep();
> -	if (!find_first_holder(gl))
> -		wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
> -			    TASK_UNINTERRUPTIBLE);
> +	wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
>  }
>  
>  /**
> 




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

end of thread, other threads:[~2014-06-26 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1660832679.3803950.1403793568127.JavaMail.zimbra@redhat.com>
2014-06-26 14:46 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allow flocks to use normal glock dq rather than dq_wait Bob Peterson
2014-06-26 16:43   ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).