public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Beschorner Daniel <Daniel.Beschorner@facton.com>
Cc: linux-kernel@vger.kernel.org, orion@cora.nwra.com,
	76306.1226@compuserve.com, sfr@canb.auug.org.au
Subject: Re: fctnl(F_SETSIG) no longer works in 2.6.17, does in 2.6.16.
Date: Tue, 08 Aug 2006 09:26:30 -0400	[thread overview]
Message-ID: <1155043590.5673.13.camel@localhost> (raw)
In-Reply-To: <664E3671B2B6DC439E0C9FFCF8E40CA205F4C6@exchange.I-BNEX>

[-- Attachment #1: Type: text/plain, Size: 868 bytes --]

On Tue, 2006-08-08 at 07:38 +0200, Beschorner Daniel wrote:
> >>> static void lease_release_private_callback(struct file_lock *fl) 
> >>> { 
> >>>         if (!fl->fl_file) 
> >>>                 return; 
> >>>         f_delown(fl->fl_file); 
> >>> =>      fl->fl_file->f_owner.signum = 0; 
> >>> } 
> 
> >> Why should the lease cleanup code be resetting f_owner.signum? That 
> >> looks wrong. 
> >> Stephen, I think this line of code predates the CITI changes. Do you 
> >> know who added it and why? 
> 
> >Because when the original code was written, it was only called when we
> got 
> >a fcntl(F_SETLEASE, F_UNLCK) call.  The code got moved incorrectly and 
> >noone noticed.
> 
> Does somebody have a patch for this issue? It breaks one important
> application (Samba) in its default configuration.
> 
> Daniel

I believe this ought to fix it.

Cheers,
  Trond


[-- Attachment #2: linux-2.6.18-fix_lease_signals.dif --]
[-- Type: message/rfc822, Size: 1243 bytes --]

From: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: No Subject
Date: Tue, 08 Aug 2006 09:26:30 -0400
Message-ID: <1155043590.5673.14.camel@localhost>

fcntl(F_SETSIG) no longer works on leases because
lease_release_private_callback() gets called as the lease is copied in
order to initialise it.
The problem is that lease_alloc() performs an unnecessary initialisation,
which sets the lease_manager_ops. Avoid the problem by allocating the
target lease structure using locks_alloc_lock().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/locks.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index b0b41a6..d7c5339 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1421,8 +1421,9 @@ static int __setlease(struct file *filp,
 	if (!leases_enable)
 		goto out;
 
-	error = lease_alloc(filp, arg, &fl);
-	if (error)
+	error = -ENOMEM;
+	fl = locks_alloc_lock();
+	if (fl == NULL)
 		goto out;
 
 	locks_copy_lock(fl, lease);
@@ -1430,6 +1431,7 @@ static int __setlease(struct file *filp,
 	locks_insert_lock(before, fl);
 
 	*flp = fl;
+	error = 0;
 out:
 	return error;
 }

  reply	other threads:[~2006-08-08 13:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08  5:38 fctnl(F_SETSIG) no longer works in 2.6.17, does in 2.6.16 Beschorner Daniel
2006-08-08 13:26 ` Trond Myklebust [this message]
2006-08-09  8:39   ` Beschorner Daniel
  -- strict thread matches above, loose matches on Subject: below --
2006-07-31  6:21 Chuck Ebbert
2006-07-31 18:23 ` Trond Myklebust
2006-08-01 14:51   ` Stephen Rothwell
2006-07-27 22:08 Orion Poplawski

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=1155043590.5673.13.camel@localhost \
    --to=trond.myklebust@fys.uio.no \
    --cc=76306.1226@compuserve.com \
    --cc=Daniel.Beschorner@facton.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orion@cora.nwra.com \
    --cc=sfr@canb.auug.org.au \
    /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