public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] vfs: Fix possible NULL pointer dereference in inode_permission()
       [not found]                 ` <20140110000642.GN10323@ZenIV.linux.org.uk>
@ 2014-01-10  9:31                   ` Christoph Hellwig
  2014-01-10 18:14                     ` Ben Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2014-01-10  9:31 UTC (permalink / raw)
  To: Al Viro
  Cc: Theodore Ts'o, Paul Moore, Matthew Wilcox, Stephen Smalley,
	LKML, Steven Rostedt, xfs, Eric Paris, James Morris,
	linux-fsdevel, stable, Andrew Morton, Paul McKenney,
	Linus Torvalds

On Fri, Jan 10, 2014 at 12:06:42AM +0000, Al Viro wrote:
> Check what XFS is doing ;-/  That's where those call_rcu() have come from.
> Sure, we can separate the simple "just do call_rcu(...->free_inode)" case
> and hit it whenever full ->free_inode is there and ->destroy_inode isn't.
> Not too pretty, but removal of tons of boilerplate might be worth doing
> that anyway.  But ->destroy_inode() is still needed for cases where fs
> has its own idea of inode lifetime rules.  Again, check what XFS is doing
> in that area...

Btw, I'd really love to get rid of the XFS ->destroy_inode abuse, it's
been a long time thorn in the flesh.

What's really needed there to make XFS behave more similar to everyone
else is a way for the filesystem to say: "I can't actually free this
inode right now, but I'll come back to you later".  That's what we
actually do right now, except we pretend that the VFS inode gets freed,
while its memory lives on (punt intended).

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vfs: Fix possible NULL pointer dereference in inode_permission()
  2014-01-10  9:31                   ` [PATCH] vfs: Fix possible NULL pointer dereference in inode_permission() Christoph Hellwig
@ 2014-01-10 18:14                     ` Ben Myers
  2014-01-11 10:32                       ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Myers @ 2014-01-10 18:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Theodore Ts'o, Paul Moore, Matthew Wilcox, Linus Torvalds,
	Eric Paris, LKML, Steven Rostedt, xfs, Al Viro, James Morris,
	linux-fsdevel, stable, Andrew Morton, Paul McKenney,
	Stephen Smalley

Christoph,

On Fri, Jan 10, 2014 at 01:31:48AM -0800, Christoph Hellwig wrote:
> On Fri, Jan 10, 2014 at 12:06:42AM +0000, Al Viro wrote:
> > Check what XFS is doing ;-/  That's where those call_rcu() have come from.
> > Sure, we can separate the simple "just do call_rcu(...->free_inode)" case
> > and hit it whenever full ->free_inode is there and ->destroy_inode isn't.
> > Not too pretty, but removal of tons of boilerplate might be worth doing
> > that anyway.  But ->destroy_inode() is still needed for cases where fs
> > has its own idea of inode lifetime rules.  Again, check what XFS is doing
> > in that area...
> 
> Btw, I'd really love to get rid of the XFS ->destroy_inode abuse, it's
> been a long time thorn in the flesh.

I believe this behavior is related to freeing of an inode cluster.

> What's really needed there to make XFS behave more similar to everyone
> else is a way for the filesystem to say: "I can't actually free this
> inode right now, but I'll come back to you later".

This test might read something like:  "If my link count has gone to zero, and I
am the last inode in my cluster to be freed, and there are other inodes from my
cluster incore, I cannot be freed."

Should be doable.  Maybe there are other reasons.

-Ben

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vfs: Fix possible NULL pointer dereference in inode_permission()
  2014-01-10 18:14                     ` Ben Myers
@ 2014-01-11 10:32                       ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-01-11 10:32 UTC (permalink / raw)
  To: Ben Myers
  Cc: Theodore Ts'o, Paul Moore, Matthew Wilcox, Linus Torvalds,
	Eric Paris, LKML, Steven Rostedt, xfs, Christoph Hellwig, Al Viro,
	James Morris, linux-fsdevel, stable, Andrew Morton, Paul McKenney,
	Stephen Smalley

On Fri, Jan 10, 2014 at 12:14:34PM -0600, Ben Myers wrote:
> > What's really needed there to make XFS behave more similar to everyone
> > else is a way for the filesystem to say: "I can't actually free this
> > inode right now, but I'll come back to you later".
> 
> This test might read something like:  "If my link count has gone to zero, and I
> am the last inode in my cluster to be freed, and there are other inodes from my
> cluster incore, I cannot be freed."

It's more complicated than that.  In theory we would free the inode
easily as soon as the VFS wants it, but performance would be horrible
as we would have to synchronously write back the inode.  Note that it
really matters for the interface, that just needs to be an:  I won't
free this right now, but I'll call you back later when I can.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-11 10:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20140109162731.12500986@gandalf.local.home>
     [not found] ` <20140109214239.GD29910@parisc-linux.org>
     [not found]   ` <20140109165012.391db81e@gandalf.local.home>
     [not found]     ` <20140109223127.GM10323@ZenIV.linux.org.uk>
     [not found]       ` <CA+55aFzCTPYEQCPnLBi1CwmMTocVqCFiCuJ391HkVx1CMw61ug@mail.gmail.com>
     [not found]         ` <20140109182523.5b50131f@gandalf.local.home>
     [not found]           ` <20140109182756.17abaaa8@gandalf.local.home>
     [not found]             ` <1389310626.15209.92.camel@localhost>
     [not found]               ` <CA+55aFzd2nw=JU4s0u=PJbATK0bwhm0kot3zRH=anLLT6THRFQ@mail.gmail.com>
     [not found]                 ` <20140110000642.GN10323@ZenIV.linux.org.uk>
2014-01-10  9:31                   ` [PATCH] vfs: Fix possible NULL pointer dereference in inode_permission() Christoph Hellwig
2014-01-10 18:14                     ` Ben Myers
2014-01-11 10:32                       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox