From: Erez Zadok <ezk@cs.sunysb.edu>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Hugh Dickins <hugh@veritas.com>, Erez Zadok <ezk@cs.sunysb.edu>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Ryan Finnie <ryan@finnie.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
cjwatson@ubuntu.com, linux-mm@kvack.org,
Christoph Hellwig <hch@infradead.org>
Subject: Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland
Date: Thu, 8 Nov 2007 21:47:02 -0500 [thread overview]
Message-ID: <200711090247.lA92l2Ct014971@agora.fsl.cs.sunysb.edu> (raw)
In-Reply-To: Your message of "Mon, 05 Nov 2007 08:38:50 PST." <1194280730.6271.145.camel@localhost>
In message <1194280730.6271.145.camel@localhost>, Dave Hansen writes:
> On Mon, 2007-11-05 at 15:40 +0000, Hugh Dickins wrote:
[...]
> I have a decent guess what the bug is, too. In the unionfs code:
>
> > int init_lower_nd(struct nameidata *nd, unsigned int flags)
> > {
> > ...
> > #ifdef ALLOC_LOWER_ND_FILE
> > file = kzalloc(sizeof(struct file), GFP_KERNEL);
> > if (unlikely(!file)) {
> > err = -ENOMEM;
> > break; /* exit switch statement and thus return */
> > }
> > nd->intent.open.file = file;
> > #endif /* ALLOC_LOWER_ND_FILE */
>
> The r/o bind mount code will mnt_drop_write() on that file's f_vfsmnt at
> __fput() time. Since that code never got a write on the mount, we'll
> see an imbalance if the file was opened for a write. I don't see this
> file's mnt set anywhere, so I'm not completely sure that this is it. In
> any case, rolling your own 'struct file' without using alloc_file() and
> friends is a no-no.
[...]
This #ifdef'd code in unionfs is actually not enabled. I left it there as a
reminder of possible future things to come (esp. if nameidata gets split).
There's a related comment earlier in fs/unionfs/lookup.c:init_lower_nd()
that says:
#ifdef ALLOC_LOWER_ND_FILE
/*
* XXX: one day we may need to have the lower return an open file
* for us. It is not needed in 2.6.23-rc1 for nfs2/nfs3, but may
* very well be needed for nfs4.
*/
struct file *file;
#endif /* ALLOC_LOWER_ND_FILE */
In the interest of keeping unionfs as simple as I can, when I implemented
the whole "pass a lower nd" stuff, I left thos bits of semi-experimental
#ifdef code for this lower file upon open-intent. It's not enabled and up
until now, it didn't seem to be needed.
Do you think unionfs has to start using this nd->intent.open.file stuff?
Thanks,
Erez.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-11-09 2:47 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200710071920.l97JKJX5018871@agora.fsl.cs.sunysb.edu>
2007-10-11 21:47 ` Andrew Morton
2007-10-11 22:12 ` Ryan Finnie
2007-10-12 0:38 ` Hugh Dickins
2007-10-12 21:45 ` Pekka Enberg
2007-10-14 8:44 ` Hugh Dickins
2007-10-14 17:09 ` Pekka Enberg
2007-10-14 17:23 ` Erez Zadok
2007-10-14 17:50 ` Pekka J Enberg
2007-10-14 22:32 ` Erez Zadok
2007-10-15 11:47 ` Pekka Enberg
2007-10-16 18:02 ` Erez Zadok
2007-10-22 20:16 ` Hugh Dickins
2007-10-22 20:48 ` Pekka Enberg
2007-10-25 15:36 ` Hugh Dickins
2007-10-25 16:44 ` Erez Zadok
2007-10-25 18:23 ` Hugh Dickins
2007-10-26 2:00 ` Neil Brown
2007-10-26 8:09 ` Pekka Enberg
2007-10-26 11:26 ` Hugh Dickins
2007-10-26 8:05 ` Pekka Enberg
2007-10-22 21:04 ` Erez Zadok
2007-10-25 16:40 ` Hugh Dickins
2007-10-24 21:02 ` [PATCH] fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE Hugh Dickins
2007-10-24 21:08 ` Andrew Morton
2007-10-24 21:37 ` [PATCH+comment] " Hugh Dickins
2007-10-25 5:37 ` Pekka Enberg
2007-10-25 6:30 ` Hugh Dickins
2007-10-25 7:24 ` Pekka Enberg
2007-10-25 16:01 ` Erez Zadok
2007-10-25 20:51 ` H. Peter Anvin
2007-10-22 20:01 ` msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland Hugh Dickins
2007-10-22 20:40 ` Pekka Enberg
2007-10-22 19:42 ` Hugh Dickins
2007-10-22 21:38 ` Erez Zadok
2007-10-25 18:03 ` Hugh Dickins
2007-10-27 20:47 ` Erez Zadok
2007-10-28 20:23 ` Erez Zadok
2007-10-29 20:33 ` Hugh Dickins
2007-10-31 23:53 ` Erez Zadok
2007-11-05 15:40 ` Hugh Dickins
2007-11-05 16:38 ` Dave Hansen
2007-11-05 18:57 ` Hugh Dickins
2007-11-09 2:47 ` Erez Zadok [this message]
2007-11-09 6:05 ` Erez Zadok
2007-11-12 5:41 ` Hugh Dickins
2007-11-12 17:01 ` Hugh Dickins
2007-11-13 10:18 ` Erez Zadok
2007-11-17 21:24 ` Hugh Dickins
2007-11-20 1:30 ` Erez Zadok
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=200711090247.lA92l2Ct014971@agora.fsl.cs.sunysb.edu \
--to=ezk@cs.sunysb.edu \
--cc=akpm@linux-foundation.org \
--cc=cjwatson@ubuntu.com \
--cc=haveblue@us.ibm.com \
--cc=hch@infradead.org \
--cc=hugh@veritas.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@cs.helsinki.fi \
--cc=ryan@finnie.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