mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <Nikita@Namesys.COM>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
	viro@parcelfarce.linux.theplanet.co.uk, trondmy@trondhjem.org,
	neilb@cse.unsw.edu.au
Subject: Re: d_splice_alias() problem.
Date: Mon, 26 Apr 2004 16:45:00 +0400	[thread overview]
Message-ID: <16525.1100.432660.844335@laputa.namesys.com> (raw)
In-Reply-To: <20040423164936.390462fb.akpm@osdl.org>

Andrew Morton writes:
 > Nikita Danilov <Nikita@Namesys.COM> wrote:
 > >
 > > for some time I am observing that during stress tests over NFS
 > > 
 > >     shrink_slab->...->prune_dcache()->prune_one_dentry()->...->iput()
 > > 
 > >  is called on inode with ->i_nlink == 0 which results in truncate and
 > >  file deletion. This is wrong in general (file system is re-entered), and
 > >  deadlock prone on some file systems.
 > 
 > The filesystem is only reentered if the caller of __alloc_pages() passed in
 > __GFP_FS, in which case the bug is in the caller, not in shrink_slab().

Well, I always thought that the only file system IO that GFP_FS is
expected to do is one issued by ->writepage. Doing truncate from within
VM scanner looks... wrong. But that's not the point, actually. Current
d_splice_alias leads to the following problems with NFS (and may be
other remote file systems also):

 * there are more dentries than nlinks for a given file, as a result

 * file (not opened by user) is not truncated when its last name is
   removed. inode is pinned in the memory indefinitely by remaining
   disconnected dentries.

 * sequence "touch x; rm x" always creates _two_ dentries for "x": one
   disconnected (by ->decode_fh) and one connected (by lookup_one_len
   from nfs unlink request).

I think that d_splice_alias() should be changed to scan inode->i_dentry
list and d_move() any disconnected dentry found into new one.

 > 

Nikita.

  reply	other threads:[~2004-04-26 12:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-23 13:02 Nikita Danilov
2004-04-23 15:40 ` Andreas Dilger
2004-04-23 16:20   ` Nikita Danilov
2004-04-23 23:49 ` Andrew Morton
2004-04-26 12:45   ` Nikita Danilov [this message]
2004-04-30  4:54 ` Neil Brown
2004-04-30  7:50   ` Greg Banks
2004-04-30 13:28   ` Nikita Danilov
2004-05-03 23:46     ` Neil Brown
2004-05-03 12:02   ` Greg Banks
2004-05-03 23:28     ` Neil Brown
2004-05-04  0:05       ` Greg Banks
2004-05-04  7:00       ` Greg Banks
2004-05-04  9:46         ` viro
2004-05-04 10:21           ` Greg Banks
2004-05-05  0:11           ` Neil Brown
2004-05-10  3:03         ` Neil Brown
2004-05-10  4:50           ` Greg Banks
2004-05-10  3:27       ` Neil Brown
2004-05-10 11:28         ` Greg Banks
2004-05-13  5:58           ` Neil Brown
2004-05-13  7:15             ` Greg Banks

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=16525.1100.432660.844335@laputa.namesys.com \
    --to=nikita@namesys.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=trondmy@trondhjem.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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®