public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Doug Chapman <doug.chapman@hp.com>
Cc: linux-kernel@vger.kernel.org, hch@infradead.org,
	Marc Eshel <eshel@almaden.ibm.com>
Subject: Re: post 2.6.21 regression in F_GETLK
Date: Thu, 10 May 2007 17:35:27 -0400	[thread overview]
Message-ID: <20070510213527.GY13719@fieldses.org> (raw)
In-Reply-To: <20070510210421.GX13719@fieldses.org>

On Thu, May 10, 2007 at 05:04:21PM -0400, bfields wrote:
> On Thu, May 10, 2007 at 05:01:05PM -0400, Doug Chapman wrote:
> > You are partly right on the test however note that it is using a start
> > and len that are specific to the RDLCK so that should _only_ conflict
> > with that lock.  I did notice that the LTP test is taking a new lock on
> > the entire file which should be blocked by eithe rthe RDLCK or the WRLCK
> > and it doesn't check both, I plan on fixing that once this is resolved.
> > 
> > But, much more importantly F_GETLK is returning F_UNLCK saying that
> > there was no conflict at all.
> 
> Argh, OK.  I still can't see the problem yet, then.  What filesystem is
> this on?

Oh, cripes.  I'm a loser.  Next to figure out what's up with the
connectathon locking tests that they pass when GETLK never finds a
conflicting lock....

--b.

diff --git a/fs/locks.c b/fs/locks.c
index 53b0cd1..7fd2d17 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -670,7 +670,6 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
 {
 	struct file_lock *cfl;
 
-	fl->fl_type = F_UNLCK;
 	lock_kernel();
 	for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {
 		if (!IS_POSIX(cfl))
@@ -682,7 +681,8 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
 		__locks_copy_lock(fl, cfl);
 		unlock_kernel();
 		return 1;
-	}
+	} else
+		fl->fl_type = F_UNLCK;
 	unlock_kernel();
 	return 0;
 }

  reply	other threads:[~2007-05-10 21:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 18:56 post 2.6.21 regression in F_GETLK Doug Chapman
2007-05-10 19:14 ` Doug Chapman
2007-05-10 19:30 ` J. Bruce Fields
2007-05-10 19:38   ` J. Bruce Fields
2007-05-10 20:23     ` J. Bruce Fields
2007-05-10 21:01       ` Doug Chapman
2007-05-10 21:04         ` J. Bruce Fields
2007-05-10 21:35           ` J. Bruce Fields [this message]
2007-05-10 20:24     ` Doug Chapman
2007-05-10 22:38   ` [PATCH] locks: fix F_GETLK regression (failure to find conflicts) J. Bruce Fields
2007-05-10 23:30     ` Doug Chapman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070510213527.GY13719@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=doug.chapman@hp.com \
    --cc=eshel@almaden.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox