public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state
@ 2013-04-11  2:05 Jonghwan Choi
  2013-04-11  7:59 ` Steven Whitehouse
  2013-04-12 16:18 ` Luis Henriques
  0 siblings, 2 replies; 3+ messages in thread
From: Jonghwan Choi @ 2013-04-11  2:05 UTC (permalink / raw)
  To: 'Jonghwan Choi', linux-kernel; +Cc: stable, 'Steven Whitehouse'

This patch looks like it should be in the 3.8-stable tree, should we apply
it?

------------------

From: "Steven Whitehouse <swhiteho@redhat.com>"

commit c2952d202f710d326ac36a8ea6bd216b20615ec8 upstream

When withdraw occurs, we need to continue to allow unlocks of fcntl
locks to occur, however these will only be local, since the node has
withdrawn from the cluster. This prevents triggering a VFS level
bug trap due to locks remaining when a file is closed.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 fs/gfs2/file.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 991ab2d..7af426b 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -924,8 +924,11 @@ static int gfs2_lock(struct file *file, int cmd, struct
file_lock *fl)
 		cmd = F_SETLK;
 		fl->fl_type = F_UNLCK;
 	}
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
+		if (fl->fl_type == F_UNLCK)
+			posix_lock_file_wait(file, fl);
 		return -EIO;
+	}
 	if (IS_GETLK(cmd))
 		return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
 	else if (fl->fl_type == F_UNLCK)
-- 
1.7.9.5


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

* Re: [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state
  2013-04-11  2:05 [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state Jonghwan Choi
@ 2013-04-11  7:59 ` Steven Whitehouse
  2013-04-12 16:18 ` Luis Henriques
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Whitehouse @ 2013-04-11  7:59 UTC (permalink / raw)
  To: Jonghwan Choi; +Cc: linux-kernel, stable

Hi,

On Thu, 2013-04-11 at 11:05 +0900, Jonghwan Choi wrote:
> This patch looks like it should be in the 3.8-stable tree, should we apply
> it?
> 
Yes, that seems reasonable to me,

Steve.

> ------------------
> 
> From: "Steven Whitehouse <swhiteho@redhat.com>"
> 
> commit c2952d202f710d326ac36a8ea6bd216b20615ec8 upstream
> 
> When withdraw occurs, we need to continue to allow unlocks of fcntl
> locks to occur, however these will only be local, since the node has
> withdrawn from the cluster. This prevents triggering a VFS level
> bug trap due to locks remaining when a file is closed.
> 
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  fs/gfs2/file.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 991ab2d..7af426b 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -924,8 +924,11 @@ static int gfs2_lock(struct file *file, int cmd, struct
> file_lock *fl)
>  		cmd = F_SETLK;
>  		fl->fl_type = F_UNLCK;
>  	}
> -	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
> +	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
> +		if (fl->fl_type == F_UNLCK)
> +			posix_lock_file_wait(file, fl);
>  		return -EIO;
> +	}
>  	if (IS_GETLK(cmd))
>  		return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
>  	else if (fl->fl_type == F_UNLCK)



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

* Re: [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state
  2013-04-11  2:05 [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state Jonghwan Choi
  2013-04-11  7:59 ` Steven Whitehouse
@ 2013-04-12 16:18 ` Luis Henriques
  1 sibling, 0 replies; 3+ messages in thread
From: Luis Henriques @ 2013-04-12 16:18 UTC (permalink / raw)
  To: Jonghwan Choi; +Cc: linux-kernel, stable, 'Steven Whitehouse'

On Thu, Apr 11, 2013 at 11:05:18AM +0900, Jonghwan Choi wrote:
> This patch looks like it should be in the 3.8-stable tree, should we apply
> it?

I believe this is also applicable to the 3.5 kernel.  Queuing it

Cheers,
--
Luis

> 
> ------------------
> 
> From: "Steven Whitehouse <swhiteho@redhat.com>"
> 
> commit c2952d202f710d326ac36a8ea6bd216b20615ec8 upstream
> 
> When withdraw occurs, we need to continue to allow unlocks of fcntl
> locks to occur, however these will only be local, since the node has
> withdrawn from the cluster. This prevents triggering a VFS level
> bug trap due to locks remaining when a file is closed.
> 
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  fs/gfs2/file.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 991ab2d..7af426b 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -924,8 +924,11 @@ static int gfs2_lock(struct file *file, int cmd, struct
> file_lock *fl)
>  		cmd = F_SETLK;
>  		fl->fl_type = F_UNLCK;
>  	}
> -	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
> +	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
> +		if (fl->fl_type == F_UNLCK)
> +			posix_lock_file_wait(file, fl);
>  		return -EIO;
> +	}
>  	if (IS_GETLK(cmd))
>  		return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
>  	else if (fl->fl_type == F_UNLCK)
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-04-12 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11  2:05 [PATCH 3.8-stable] GFS2: Fix unlock of fcntl locks during withdrawn state Jonghwan Choi
2013-04-11  7:59 ` Steven Whitehouse
2013-04-12 16:18 ` Luis Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox