public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dwight Engen <dwight.engen@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v4 6/7] xfs: check that eofblocks ioctl caller can write matched inodes
Date: Mon, 22 Jul 2013 12:00:07 -0400	[thread overview]
Message-ID: <20130722120007.2a82cea5@oracle.com> (raw)
In-Reply-To: <20130719060221.GX11674@dastard>

On Fri, 19 Jul 2013 16:02:21 +1000
Dave Chinner <david@fromorbit.com> wrote:

[...]
> > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> > index d873ab9e..728283a 100644
> > --- a/fs/xfs/xfs_icache.c
> > +++ b/fs/xfs/xfs_icache.c
> > @@ -1247,6 +1247,10 @@ xfs_inode_free_eofblocks(
> >  		if (!xfs_inode_match_id(ip, eofb))
> >  			return 0;
> >  
> > +		if (eofb->eof_flags & XFS_EOF_FLAGS_PERM_CHECK &&
> > +		    inode_permission(VFS_I(ip), MAY_WRITE))
> > +			return 0;
> 
> This assumes we are walking fully instantiated VFS inodes. That's
> not necessarily true - we may be walking inodes that have already
> been dropped from the VFS and are waiting for background reclaim to

Hi Dave, in looking at this a bit I don't see how they can be dropped
from the VFS since they are igrab()ed in the flow:

xfs_icache_free_eofblocks
  xfs_inode_ag_iterator_tag
    xfs_inode_ag_walk
      xfs_inode_ag_walk_grab
        igrab

and I don't see a way for xfs_inode_free_eofblocks() to be called other
than the ag_walk flow.

If there is a way to get into xfs_inode_free_eofblocks where we can't
use VFS_I(ip) then it will be a problem for the new code in
xfs_inode_match_id() as well.

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

  parent reply	other threads:[~2013-07-22 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 15:47 [PATCH v4 6/7] xfs: check that eofblocks ioctl caller can write matched inodes Dwight Engen
2013-07-19  6:02 ` Dave Chinner
2013-07-19 16:13   ` Dwight Engen
2013-07-24  3:40     ` Dave Chinner
2013-07-22 16:00   ` Dwight Engen [this message]
2013-07-24  3:46     ` Dave Chinner

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=20130722120007.2a82cea5@oracle.com \
    --to=dwight.engen@oracle.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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