04 Jan, 2012

1 commit

  • Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
    it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
    the cost of taking it into inode_init_always() will be negligible for pipes
    and sockets and negative for everything else. Not to mention the removal of
    boilerplate code from ->destroy_inode() instances...

    Signed-off-by: Al Viro

    Al Viro
     

12 Oct, 2011

1 commit

  • We now have an i_dio_count filed and surrounding infrastructure to wait
    for direct I/O completion instead of i_icount, and we have never needed
    to iocount waits for buffered I/O given that we only set the page uptodate
    after finishing all required work. Thus remove i_iocount, and replace
    the actually needed waits with calls to inode_dio_wait.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

13 Jul, 2011

1 commit


24 Jun, 2011

1 commit

  • XFS inodes has several per-lifetime state fields that determine the
    behaviour of the inode. These state fields are not all reset when an
    inode is reused from the reclaimable state.

    This can lead to unexpected behaviour of the new inode such as
    speculative preallocation not being truncated away in the expected
    manner for local files until the inode is subsequently truncated,
    freed or cycles out of the cache. It can also lead to an inode being
    considered to be a filestream inode or having been truncated when
    that is not the case.

    Rework the reinitialisation of the inode when it is recycled to
    ensure that it is pristine before it is reused. While there, also
    fix the resetting of state flags in the recycling error paths so the
    inode does not become unreclaimable.

    Signed-off-by: Dave Chinner
    Signed-off-by: Alex Elder

    Dave Chinner
     

11 Jan, 2011

1 commit

  • This merge pulls the XFS master branch into the latest Linus master.
    This results in a merge conflict whose best fix is not obvious.
    I manually fixed the conflict, in "fs/xfs/xfs_iget.c".

    Dave Chinner had done work that resulted in RCU freeing of inodes
    separate from what Nick Piggin had done, and their results differed
    slightly in xfs_inode_free(). The fix updates Nick's call_rcu()
    with the use of VFS_I(), while incorporating needed updates to some
    XFS inode fields implemented in Dave's series. Dave's RCU callback
    function has also been removed.

    Signed-off-by: Alex Elder

    Alex Elder
     

07 Jan, 2011

1 commit

  • RCU free the struct inode. This will allow:

    - Subsequent store-free path walking patch. The inode must be consulted for
    permissions when walking, so an RCU inode reference is a must.
    - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
    to take i_lock no longer need to take sb_inode_list_lock to walk the list in
    the first place. This will simplify and optimize locking.
    - Could remove some nested trylock loops in dcache code
    - Could potentially simplify things a bit in VM land. Do not need to take the
    page lock to follow page->mapping.

    The downsides of this is the performance cost of using RCU. In a simple
    creat/unlink microbenchmark, performance drops by about 10% due to inability to
    reuse cache-hot slab objects. As iterations increase and RCU freeing starts
    kicking over, this increases to about 20%.

    In cases where inode lifetimes are longer (ie. many inodes may be allocated
    during the average life span of a single inode), a lot of this cache reuse is
    not applicable, so the regression caused by this patch is smaller.

    The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
    however this adds some complexity to list walking and store-free path walking,
    so I prefer to implement this at a later date, if it is shown to be a win in
    real situations. I haven't found a regression in any non-micro benchmark so I
    doubt it will be a problem.

    Signed-off-by: Nick Piggin

    Nick Piggin
     

23 Dec, 2010

1 commit

  • The XFS iolock needs to be re-initialised to a new lock class before
    it enters reclaim to prevent lockdep false positives. Unfortunately,
    this is not sufficient protection as inodes in the XFS_IRECLAIMABLE
    state can be recycled and not re-initialised before being reused.

    We need to re-initialise the lock state when transfering out of
    XFS_IRECLAIMABLE state to XFS_INEW, but we need to keep the same
    class as if the inode was just allocated. Hence we need a specific
    lockdep class variable for the iolock so that both initialisations
    use the same class.

    While there, add a specific class for inodes in the reclaim state so
    that it is easy to tell from lockdep reports what state the inode
    was in that generated the report.

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig

    Dave Chinner
     

17 Dec, 2010

1 commit

  • With delayed logging greatly increasing the sustained parallelism of inode
    operations, the inode cache locking is showing significant read vs write
    contention when inode reclaim runs at the same time as lookups. There is
    also a lot more write lock acquistions than there are read locks (4:1 ratio)
    so the read locking is not really buying us much in the way of parallelism.

    To avoid the read vs write contention, change the cache to use RCU locking on
    the read side. To avoid needing to RCU free every single inode, use the built
    in slab RCU freeing mechanism. This requires us to be able to detect lookups of
    freed inodes, so enѕure that ever freed inode has an inode number of zero and
    the XFS_IRECLAIM flag set. We already check the XFS_IRECLAIM flag in cache hit
    lookup path, but also add a check for a zero inode number as well.

    We canthen convert all the read locking lockups to use RCU read side locking
    and hence remove all read side locking.

    Signed-off-by: Dave Chinner
    Reviewed-by: Alex Elder

    Dave Chinner
     

16 Dec, 2010

2 commits

  • now that we are using RCU protection for the inode cache lookups,
    the lock is only needed on the modification side. Hence it is not
    necessary for the lock to be a rwlock as there are no read side
    holders anymore. Convert it to a spin lock to reflect it's exclusive
    nature.

    Signed-off-by: Dave Chinner
    Reviewed-by: Alex Elder
    Reviewed-by: Christoph Hellwig

    Dave Chinner
     
  • Introduce RCU freeing of XFS inodes so that we can convert lookup
    traversals to use rcu_read_lock() protection. This patch only
    introduces the RCU freeing to minimise the potential conflicts with
    mainline if this is merged into mainline via a VFS patchset. It
    abuses the i_dentry list for the RCU callback structure because the
    VFS patches make this a union so it is safe to use like this and
    simplifies and merge issues.

    This patch uses basic RCU freeing rather than SLAB_DESTROY_BY_RCU.
    The later lookup patches need the same "found free inode" protection
    regardless of the RCU freeing method used, so once again the RCU
    freeing method can be dealt with apprpriately at merge time without
    affecting any other code.

    Signed-off-by: Dave Chinner
    Reviewed-by: Paul E. McKenney

    Dave Chinner
     

19 Oct, 2010

1 commit

  • These days inode64 should only control which AGs we allocate new
    inodes from, while we still try to support reading all existing
    inodes. To make this actually work the check ontop of xfs_iget
    needs to be relaxed to allow inodes in all allocation groups instead
    of just those that we allow allocating inodes from. Note that we
    can't simply remove the check - it prevents us from accessing
    invalid data when fed invalid inode numbers from NFS or bulkstat.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

27 Jul, 2010

7 commits

  • [hch: dropped a few hunks that need structural changes instead]

    Signed-off-by: Andi Kleen
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • xfs_ireclaim has to get and put te pag structure because it is only
    called with the inode to reclaim. The one caller of this function
    already has a reference on the pag and a pointer to is, so move the
    radix tree delete to the caller and remove xfs_ireclaim completely.
    This avoids a xfs_perag_get/put on every inode being reclaimed.

    The overhead was noticed in a bug report at:

    https://bugzilla.kernel.org/show_bug.cgi?id=16348

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Alex Elder
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • xfs_iput is just a small wrapper for xfs_iunlock + IRELE. Having this
    out of line wrapper means the trace events in those two can't track
    their caller properly. So just remove the wrapper and opencode the
    unlock + rele in the few callers.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • We never get an i_mode of 0 or a locked VFS inode until we pass in the
    XFS_IGET_CREATE flag to xfs_iget, which makes xfs_iput_new equivalent to
    xfs_iput for the only caller. In addition to that xfs_nfs_get_inode
    does not even need to lock the inode given that the generation never changes
    for a life inode, so just pass a 0 lock_flags to xfs_iget and release
    the inode using IRELE in the error path.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • The xfs_iget_alloc/found tracepoints are a bit misnamed and misplaced.
    Rename them to xfs_iget_hit/xfs_iget_miss and move them to the beggining
    of the xfs_iget_cache_hit/miss functions. Add a new xfs_iget_reclaim_fail
    tracepoint for the case where we fail to re-initialize a VFS inode,
    and add a second instance of the xfs_iget_skip tracepoint for the case
    of a failed igrab() call.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Dmapi support was never merged upstream, but we still have a lot of hooks
    bloating XFS for it, all over the fast pathes of the filesystem.

    This patch drops over 700 lines of dmapi overhead. If we'll ever get HSM
    support in mainline at least the namespace events can be done much saner
    in the VFS instead of the individual filesystem, so it's not like this
    is much help for future work.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     

24 Jun, 2010

1 commit

  • The block number comes from bulkstat based inode lookups to shortcut
    the mapping calculations. We ar enot able to trust anything from
    bulkstat, so drop the block number as well so that the correct
    lookups and mappings are always done.

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig

    Dave Chinner
     

03 Jun, 2010

1 commit


29 May, 2010

1 commit

  • If a filesystem is mounted without the inode64 mount option we
    should still be able to access inodes not fitting into 32 bits, just
    not created new ones. For this to work we need to make sure the
    inode cache radix tree is initialized for all allocation groups, not
    just those we plan to allocate inodes from. This patch makes sure
    we initialize the inode cache radix tree for all allocation groups,
    and also cleans xfs_initialize_perag up a bit to separate the
    inode32 logical from the general perag structure setup.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

02 Mar, 2010

1 commit

  • The radix-tree code requires it's users to serialize tag updates
    against other updates to the tree. While XFS protects tag updates
    against each other it does not serialize them against updates of the
    tree contents, which can lead to tag corruption. Fix the inode
    cache to always take pag_ici_lock in exclusive mode when updating
    radix tree tags.

    Signed-off-by: Christoph Hellwig
    Reported-by: Patrick Schreurs
    Tested-by: Patrick Schreurs
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

16 Jan, 2010

2 commits

  • xfs_get_perag is really getting the perag that an inode belongs to
    based on it's inode number. Convert the use of this function to just
    get the perag from a provided ag number. Use this new function to
    obtain the per-ag structure when traversing the per AG inode trees
    for sync and reclaim.

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Dave Chinner
     
  • lockdep complains about a the lock not being initialised as we do an
    ASSERT based check that the lock is not held before we initialise it
    to catch inodes freed with the lock held.

    lockdep does this check for us in the lock initialisation code, so
    remove the ASSERT to stop the lockdep warning.

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Dave Chinner
     

18 Dec, 2009

1 commit

  • After I_SYNC was split from I_LOCK the leftover is always used together with
    I_NEW and thus superflous.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

17 Dec, 2009

1 commit


15 Dec, 2009

1 commit

  • Convert the old xfs tracing support that could only be used with the
    out of tree kdb and xfsidbg patches to use the generic event tracer.

    To use it make sure CONFIG_EVENT_TRACING is enabled and then enable
    all xfs trace channels by:

    echo 1 > /sys/kernel/debug/tracing/events/xfs/enable

    or alternatively enable single events by just doing the same in one
    event subdirectory, e.g.

    echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable

    or set more complex filters, etc. In Documentation/trace/events.txt
    all this is desctribed in more detail. To reads the events do a

    cat /sys/kernel/debug/tracing/trace

    Compared to the last posting this patch converts the tracing mostly to
    the one tracepoint per callsite model that other users of the new
    tracing facility also employ. This allows a very fine-grained control
    of the tracing, a cleaner output of the traces and also enables the
    perf tool to use each tracepoint as a virtual performance counter,
    allowing us to e.g. count how often certain workloads git various
    spots in XFS. Take a look at

    http://lwn.net/Articles/346470/

    for some examples.

    Also the btree tracing isn't included at all yet, as it will require
    additional core tracing features not in mainline yet, I plan to
    deliver it later.

    And the really nice thing about this patch is that it actually removes
    many lines of code while adding this nice functionality:

    fs/xfs/Makefile | 8
    fs/xfs/linux-2.6/xfs_acl.c | 1
    fs/xfs/linux-2.6/xfs_aops.c | 52 -
    fs/xfs/linux-2.6/xfs_aops.h | 2
    fs/xfs/linux-2.6/xfs_buf.c | 117 +--
    fs/xfs/linux-2.6/xfs_buf.h | 33
    fs/xfs/linux-2.6/xfs_fs_subr.c | 3
    fs/xfs/linux-2.6/xfs_ioctl.c | 1
    fs/xfs/linux-2.6/xfs_ioctl32.c | 1
    fs/xfs/linux-2.6/xfs_iops.c | 1
    fs/xfs/linux-2.6/xfs_linux.h | 1
    fs/xfs/linux-2.6/xfs_lrw.c | 87 --
    fs/xfs/linux-2.6/xfs_lrw.h | 45 -
    fs/xfs/linux-2.6/xfs_super.c | 104 ---
    fs/xfs/linux-2.6/xfs_super.h | 7
    fs/xfs/linux-2.6/xfs_sync.c | 1
    fs/xfs/linux-2.6/xfs_trace.c | 75 ++
    fs/xfs/linux-2.6/xfs_trace.h | 1369 +++++++++++++++++++++++++++++++++++++++++
    fs/xfs/linux-2.6/xfs_vnode.h | 4
    fs/xfs/quota/xfs_dquot.c | 110 ---
    fs/xfs/quota/xfs_dquot.h | 21
    fs/xfs/quota/xfs_qm.c | 40 -
    fs/xfs/quota/xfs_qm_syscalls.c | 4
    fs/xfs/support/ktrace.c | 323 ---------
    fs/xfs/support/ktrace.h | 85 --
    fs/xfs/xfs.h | 16
    fs/xfs/xfs_ag.h | 14
    fs/xfs/xfs_alloc.c | 230 +-----
    fs/xfs/xfs_alloc.h | 27
    fs/xfs/xfs_alloc_btree.c | 1
    fs/xfs/xfs_attr.c | 107 ---
    fs/xfs/xfs_attr.h | 10
    fs/xfs/xfs_attr_leaf.c | 14
    fs/xfs/xfs_attr_sf.h | 40 -
    fs/xfs/xfs_bmap.c | 507 +++------------
    fs/xfs/xfs_bmap.h | 49 -
    fs/xfs/xfs_bmap_btree.c | 6
    fs/xfs/xfs_btree.c | 5
    fs/xfs/xfs_btree_trace.h | 17
    fs/xfs/xfs_buf_item.c | 87 --
    fs/xfs/xfs_buf_item.h | 20
    fs/xfs/xfs_da_btree.c | 3
    fs/xfs/xfs_da_btree.h | 7
    fs/xfs/xfs_dfrag.c | 2
    fs/xfs/xfs_dir2.c | 8
    fs/xfs/xfs_dir2_block.c | 20
    fs/xfs/xfs_dir2_leaf.c | 21
    fs/xfs/xfs_dir2_node.c | 27
    fs/xfs/xfs_dir2_sf.c | 26
    fs/xfs/xfs_dir2_trace.c | 216 ------
    fs/xfs/xfs_dir2_trace.h | 72 --
    fs/xfs/xfs_filestream.c | 8
    fs/xfs/xfs_fsops.c | 2
    fs/xfs/xfs_iget.c | 111 ---
    fs/xfs/xfs_inode.c | 67 --
    fs/xfs/xfs_inode.h | 76 --
    fs/xfs/xfs_inode_item.c | 5
    fs/xfs/xfs_iomap.c | 85 --
    fs/xfs/xfs_iomap.h | 8
    fs/xfs/xfs_log.c | 181 +----
    fs/xfs/xfs_log_priv.h | 20
    fs/xfs/xfs_log_recover.c | 1
    fs/xfs/xfs_mount.c | 2
    fs/xfs/xfs_quota.h | 8
    fs/xfs/xfs_rename.c | 1
    fs/xfs/xfs_rtalloc.c | 1
    fs/xfs/xfs_rw.c | 3
    fs/xfs/xfs_trans.h | 47 +
    fs/xfs/xfs_trans_buf.c | 62 -
    fs/xfs/xfs_vnodeops.c | 8
    70 files changed, 2151 insertions(+), 2592 deletions(-)

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

12 Dec, 2009

2 commits

  • xfs_iget_cache_miss does not get called with the pag_ici_lock held, so
    the __releases annotation is incorrect.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Alex Elder

    Christoph Hellwig
     
  • The iolock is used for protecting reads, writes and block truncates
    against each other. We have two classes of callers, the first one is
    induced by a file operation and requires a reference to the inode be
    held and not dropped after the operation is done:

    - xfs_vm_vmap, xfs_vn_fallocate, xfs_read, xfs_write, xfs_splice_read,
    xfs_splice_write and xfs_setattr are all implementations of VFS
    methods that require a live inode
    - xfs_getbmap and xfs_swap_extents are ioctl subcommand for which the
    same is true
    - xfs_truncate_file is only called on quota inodes just returned from
    xfs_iget
    - xfs_sync_inode_data does the lock just after an igrab()
    - xfs_filestream_associate and xfs_filestream_new_ag take the iolock
    on the parent inode of an inode which by VFS rules must be referenced

    And we have various calls to truncate blocks past EOF or the whole
    file when dropping the last reference to an inode. Unfortunately
    lockdep complains when we do memory allocations that can recurse into
    the filesystem in the first class because the second class happens to
    take the same lock. To avoid this re-init the iolock in the beginning
    of xfs_fs_clear_inode to get a new lock class.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Alex Elder
    Signed-off-by: Alex Elder

    Christoph Hellwig
     

02 Sep, 2009

2 commits

  • xfs_trans_iget is a wrapper for xfs_iget that adds the inode to the
    transaction after it is read. Except when the inode already is in the
    inode cache, in which case it returns the existing locked inode with
    increment lock recursion counts.

    Now, no one in the tree every decrements these lock recursion counts,
    so any user of this gets a potential double unlock when both the original
    owner of the inode and the xfs_trans_iget caller unlock it. When looking
    back in a git bisect in the historic XFS tree there was only one place
    that decremented these counts, xfs_trans_iput. Introduced in commit
    ca25df7a840f426eb566d52667b6950b92bb84b5 by Adam Sweeney in 1993,
    and removed in commit 19f899a3ab155ff6a49c0c79b06f2f61059afaf3 by
    Steve Lord in 2003. And as long as it didn't slip through git bisects
    cracks never actually used in that time frame.

    A quick audit of the callers of xfs_trans_iget shows that no caller
    really relies on this behaviour fortunately - xfs_ialloc allows this
    inode from disk so it must not be there before, and all the RT allocator
    routines only every add each RT bitmap inode once.

    In addition to removing lots of code and reducing the size of the inode
    item this patch also avoids the double inode cache lookup in each
    create/mkdir/mknod transaction.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Alex Elder
    Signed-off-by: Felix Blyakher

    Christoph Hellwig
     
  • The guarantees for O_SYNC are exactly the same as the ones we need to
    make for an fsync call (and given that Linux O_SYNC is O_DSYNC the
    equivalent is fdadatasync, but we treat both the same in XFS), except
    with a range data writeout. Jan Kara has started unifying these two
    path for filesystems using the generic helpers, and I've started to
    look at XFS.

    The actual transaction commited by xfs_fsync and xfs_write_sync_logforce
    has a different transaction number, but actually is exactly the same.
    We'll only use the fsync transaction going forward. One major difference
    is that xfs_write_sync_logforce never issues a cache flush unless we
    commit a transaction causing that as a side-effect, which is an obvious
    bug in the O_SYNC handling. Second all the locking and i_update_size
    vs i_update_core changes from 978b7237123d007b9fa983af6e0e2fa8f97f9934
    never made it to xfs_write_sync_logforce, so we add them back.

    To make xfs_fsync easily usable from the O_SYNC path, the filemap_fdatawait
    call is moved up to xfs_file_fsync, so that we don't wait on the whole
    file after we already waited for our portion in xfs_write.

    We'll also use a plain call to filemap_write_and_wait_range instead
    of the previous sync_page_rang which did it in two steps including
    an half-hearted inode write out that doesn't help us.

    Once we're done with this also remove the now useless i_update_size
    tracking.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Felix Blyakher
    Signed-off-by: Felix Blyakher

    Christoph Hellwig
     

17 Aug, 2009

1 commit

  • The locking in xfs_iget_cache_hit currently has numerous problems:

    - we clear the reclaim tag without i_flags_lock which protects
    modifications to it
    - we call inode_init_always which can sleep with pag_ici_lock
    held (this is oss.sgi.com BZ #819)
    - we acquire and drop i_flags_lock a lot and thus provide no
    consistency between the various flags we set/clear under it

    This patch fixes all that with a major revamp of the locking in
    the function. The new version acquires i_flags_lock early and
    only drops it once we need to call into inode_init_always or before
    calling xfs_ilock.

    This patch fixes a bug seen in the wild where we race modifying the
    reclaim tag.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Felix Blyakher
    Reviewed-by: Eric Sandeen
    Signed-off-by: Felix Blyakher

    Christoph Hellwig
     

08 Aug, 2009

2 commits

  • When freeing an inode that lost race getting added to the inode cache we
    must not call into ->destroy_inode, because that would delete the inode
    that won the race from the inode cache radix tree.

    This patch uses splits a new xfs_inode_free helper out of xfs_ireclaim
    and uses that plus __destroy_inode to make sure we really only free
    the memory allocted for the inode that lost the race, and not mess with
    the inode cache state.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Sandeen
    Reported-by: Alex Samad
    Reported-by: Andrew Randrianasulu
    Reported-by: Stephane
    Reported-by: Tommy
    Reported-by: Miah Gregory
    Reported-by: Gabriel Barazer
    Reported-by: Leandro Lucarella
    Reported-by: Daniel Burr
    Reported-by: Nickolay
    Reported-by: Michael Guntsche
    Reported-by: Dan Carley
    Reported-by: Michael Ole Olsen
    Reported-by: Michael Weissenbacher
    Reported-by: Martin Spott
    Reported-by: Christian Kujau
    Tested-by: Michael Guntsche
    Tested-by: Dan Carley
    Tested-by: Christian Kujau

    Christoph Hellwig
     
  • Currently inode_init_always calls into ->destroy_inode if the additional
    initialization fails. That's not only counter-intuitive because
    inode_init_always did not allocate the inode structure, but in case of
    XFS it's actively harmful as ->destroy_inode might delete the inode from
    a radix-tree that has never been added. This in turn might end up
    deleting the inode for the same inum that has been instanciated by
    another process and cause lots of cause subtile problems.

    Also in the case of re-initializing a reclaimable inode in XFS it would
    free an inode we still want to keep alive.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Sandeen

    Christoph Hellwig
     

24 Jun, 2009

1 commit


10 Jun, 2009

1 commit

  • This patch rips out the XFS ACL handling code and uses the generic
    fs/posix_acl.c code instead. The ondisk format is of course left
    unchanged.

    This also introduces the same ACL caching all other Linux filesystems do
    by adding pointers to the acl and default acl in struct xfs_inode.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Sandeen

    Christoph Hellwig
     

08 Jun, 2009

1 commit

  • Kill the quota ops function vector and replace it with direct calls or
    stubs in the CONFIG_XFS_QUOTA=n case.

    Make sure we check XFS_IS_QUOTA_RUNNING in the right spots. We can remove
    the number of those checks because the XFS_TRANS_DQ_DIRTY flag can't be set
    otherwise.

    This brings us back closer to the way this code worked in IRIX and earlier
    Linux versions, but we keep a lot of the more useful factoring of common
    code.

    Eventually we should also kill xfs_qm_bhv.c, but that's left for a later
    patch.

    Reduces the size of the source code by about 250 lines and the size of
    XFS module by about 1.5 kilobytes with quotas enabled:

    text data bss dec hex filename
    615957 2960 3848 622765 980ad fs/xfs/xfs.o
    617231 3152 3848 624231 98667 fs/xfs/xfs.o.old

    Fallout:

    - xfs_qm_dqattach is split into xfs_qm_dqattach_locked which expects
    the inode locked and xfs_qm_dqattach which does the locking around it,
    thus removing XFS_QMOPT_ILOCKED.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Sandeen

    Christoph Hellwig
     

07 Apr, 2009

1 commit

  • If we fail to initialise the VFS inode in inode_init_always(),
    it will call ->delete_inode internally resulting in the inode being
    freed. Hence we need to delay the call to inode_init_always()
    until after the XFS inode is sufficient set up to handle a
    call to ->delete_inode, and then if that fails do not touch
    the inode again at all as it has been freed.

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig

    Dave Chinner
     

04 Mar, 2009

1 commit

  • The inode can't be locked by anyone else as we just created it a few
    lines above and it's not been added to any lookup data structure yet.

    So use a trylock that must succeed to get around the lockdep warnings.

    Signed-off-by: Christoph Hellwig
    Reported-by: Alexander Beregalov
    Reviewed-by: Eric Sandeen
    Reviewed-by: Felix Blyakher
    Signed-off-by: Felix Blyakher

    Christoph Hellwig
     

04 Dec, 2008

1 commit