xfs: update for 3.9-rc1

For 3.9-rc1 there are primarily bugfixes and a few cleanups.

- fix(es) for compound buffers
- remove unused XFS_TRANS_DEBUG routines
- fix for dquot soft timer asserts due to overflow of d_blk_softlimit
- don't zero allocation args structure members after they are memset(0)
- fix for regression in dir v2 code introduced in commit 20f7e9f3
- remove obsolete simple_strto<foo>
- fix return value when filesystem probe finds no XFS magic, a
  regression introduced in 9802182.
- remove boolean_t typedef completely
- fix stack switch in __xfs_bmapi_allocate by moving the check for stack
  switch up into xfs_bmapi_write.
- fix build error due to incomplete boolean_t removal
- fix oops in _xfs_buf_find by validating that the requested block is
  within the filesystem bounds.
- limit speculative preallocation near ENOSPC.
- fix an unmount hang in xfs_wait_buftarg by freeing the
  xfs_buf_log_item in xfs_buf_item_unlock.
- fix a possible use after free with AIO.
- fix xfs_swap_extents after removal of xfs_flushinval_pages, a
  regression introduced in fb59581404a.
- replace hardcoded 128 with log header size
- add memory barrier before wake_up_bit in xfs_ifunlock
- limit speculative preallocation on sparse files
- fix xa_lock recursion bug introduced in 90810b9e82a3
- fix write verifier for symlinks
xfs: xfs_bmap_add_attrfork_local is too generic

When we are converting local data to an extent format as a result of
adding an attribute, the type of data contained in the local fork
determines the behaviour that needs to occur.

xfs_bmap_add_attrfork_local() already handles the directory data
case specially by using S_ISDIR() and calling out to
xfs_dir2_sf_to_block(), but with verifiers we now need to handle
each different type of metadata specially and different metadata
formats require different verifiers (and eventually block header
initialisation).

There is only a single place that we add and attribute fork to
the inode, but that is in the attribute code and it knows nothing
about the specific contents of the data fork. It is only the case of
local data that is the issue here, so adding code to hadnle this
case in the attribute specific code is wrong. Hence we are really
stuck trying to detect the data fork contents in
xfs_bmap_add_attrfork_local() and performing the correct callout
there.

Luckily the current cases can be determined by S_IS* macros, and we
can push the work off to data specific callouts, but each of those
callouts does a lot of work in common with
xfs_bmap_local_to_extents(). The only reason that this fails for
symlinks right now is is that xfs_bmap_local_to_extents() assumes
the data fork contains extent data, and so attaches a a bmap extent
data verifier to the buffer and simply copies the data fork
information straight into it.

To fix this, allow us to pass a "formatting" callback into
xfs_bmap_local_to_extents() which is responsible for setting the
buffer type, initialising it and copying the data fork contents over
to the new buffer. This allows callers to specify how they want to
format the new buffer (which is necessary for the upcoming CRC
enabled metadata blocks) and hence make xfs_bmap_local_to_extents()
useful for any type of data fork content.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com> 
Signed-off-by: Ben Myers <bpm@sgi.com>

1 file changed