LTP's iogen01 doio tests used to hang nicely on 32-bit SMP when /tmp was a
authorHugh Dickins <hugh@veritas.com>
Mon, 28 Jul 2008 04:25:46 +0000 (00:25 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 6 Aug 2010 03:01:29 +0000 (23:01 -0400)
commit908b8302c72bc0a294b0c57346f7f7ad7f31a83c
tree6332981a1ec6682834d4d3f6f9f8e0d1a637f562
parentd099107489ac83f54c136309dfd3dcc2354ee55f
LTP's iogen01 doio tests used to hang nicely on 32-bit SMP when /tmp was a

unionfs mount of a tmpfs, i_size_read spinning forever, waiting for a lost
seqcount update: fixed by taking i_lock around i_size_write when 32-bit
SMP.

But akpm was dissatisfied with the resulting patch: its lack of
commentary, the #ifs, the nesting around i_size_read, the lack of
attention to i_blocks.  I promised to redo it with the general
spin_lock_32bit() he proposed; but disliked the result, partly because
"32bit" obscures the real constraints, which are best commented within
fsstack_copy_inode_size itself.

This version adds those comments, and uses sizeof comparisons which the
compiler can optimize out, instead of CONFIG_SMP, CONFIG_LSF.
BITS_PER_LONG.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Erez Zadok <ezk@cs.sunysb.edu>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: <hooanon05@yahoo.co.jp>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/stack.c
include/linux/fs_stack.h