mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: generic_setlease and tmpfs -- LTP fcntl failure
Date: Wed, 14 Nov 2007 15:19:31 -0600	[thread overview]
Message-ID: <4DACDAEF-A2B4-438D-A330-85FD5E65E3DE@kernel.crashing.org> (raw)

In debugging a LTP failure related to fcntl on tmpfs it appears that  
we aren't able to use fcntl(fd, F_SETLEASE, F_WRLCK).  In the  
debugging it looks like we artificial increase the dentry->d_count  
and so generic_setlease() always fails with -EAGAIN since it appears  
dentry->d_count will be 2.

This is my first time delving into fs code so I'm not that familiar  
with why tmpfs is artificially increasing the d_count.  I was  
wondering what a possible solution would be.

Maybe something like:

shmem_setlease(...) {
	if (arg == F_WRLCK) {
		dput(dentry)
		generic_setlease(...)
		dget(dentry)
	} else {
		generic_setlease(...)
	}
}

Not sure what harm doing the dput() / dget() will have.

- k

             reply	other threads:[~2007-11-14 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 21:19 Kumar Gala [this message]
2007-11-14 22:50 ` J. Bruce Fields

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=4DACDAEF-A2B4-438D-A330-85FD5E65E3DE@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=akpm@linux-foundation.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

all inboxes | Powered by JetHome®