#
a138b4b6 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: unify the logics for collecting adjacent data blocks to free
open-coded in several places...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
a9657423 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_branch(): separate the calls with non-NULL offsets
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
97e0f8f8 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_branch(): never call with offsets != NULL && depth2 == 0
For calls in __ufs_truncate_blocks() it's just a matter of not incrementing offsets[0] and not making that call - immediately follo
ufs_trunc_branch(): never call with offsets != NULL && depth2 == 0
For calls in __ufs_truncate_blocks() it's just a matter of not incrementing offsets[0] and not making that call - immediately following loop will be executed one extra time and we'll be just fine. For recursive call in ufs_trunc_branch() itself, just assing NULL to offsets if we would be about to make such call.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
42432739 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
__ufs_trunc_blocks(): turn the part after switch into a loop
... and turn the switch into if (), since all cases with depth != 1 have just become identical.
Signed-off-by: Al Viro <viro@zeniv.linux
__ufs_trunc_blocks(): turn the part after switch into a loop
... and turn the switch into if (), since all cases with depth != 1 have just become identical.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
ef3a315d |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
__ufs_truncate_blocks(): unify freeing the full branches
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
9e0fbbde |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
unify ufs_trunc_..indirect()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
6775e24d |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_..indirect(): more massage towards unifying
Instead of manually checking that the array contains only zeroes, find the position of the last non-zero (in __ufs_truncate(), where we can conv
ufs_trunc_..indirect(): more massage towards unifying
Instead of manually checking that the array contains only zeroes, find the position of the last non-zero (in __ufs_truncate(), where we can conveniently do that) and use that to tell if there's any non-zero in the array tail passed to ufs_trunc_...indirect().
The goal of all that clumsiness is to get fold these functions together.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
85416288 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_...indirect(): pass the array of indices instead of offsets
rather than bitslicing the offset just formed as sum of shifted indices, pass the array of those indices itself. NULL is used a
ufs_trunc_...indirect(): pass the array of indices instead of offsets
rather than bitslicing the offset just formed as sum of shifted indices, pass the array of those indices itself. NULL is used as equivalent of "all zeroes" (== free the entire branch).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
7a4fdda7 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
__ufs_truncate(); find cutoff distances into branches by offsets[] array
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
7bad5939 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_dindirect(): pass the number of blocks to keep
same as the previous two.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
6ac36b87 |
| 17-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_indirect(): pass the index of the first pointer to free
... instead of file offset. Same cleanups as in the tindirect conversion in previous commit.
Signed-off-by: Al Viro <viro@zeniv.li
ufs_trunc_indirect(): pass the index of the first pointer to free
... instead of file offset. Same cleanups as in the tindirect conversion in previous commit.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
18ca51d8 |
| 18-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs_trunc_tindirect(): pass the number of blocks to keep
IOW, the distance of cutoff from the begining of the branch (in blocks).
That (and the fact that block just prior to cutoff is guaranteed to
ufs_trunc_tindirect(): pass the number of blocks to keep
IOW, the distance of cutoff from the begining of the branch (in blocks).
That (and the fact that block just prior to cutoff is guaranteed to be present) allows to tell whether to free triple indirect block just by looking at the offset.
While we are at it, using u64 for index in the block is wrong - those should be unsigned int.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
31cd043e |
| 17-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: beginning of __ufs_truncate_block() massage
Use ufs_block_to_path() to find the cutoff path in the block pointers' tree. For now just use the information about the depth (to bypass the fully pr
ufs: beginning of __ufs_truncate_block() massage
Use ufs_block_to_path() to find the cutoff path in the block pointers' tree. For now just use the information about the depth (to bypass the fully preserved subtrees); subsequent commits will use the information about actual path.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
4e3911f3 |
| 04-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: the offsets ufs_block_to_path() puts into array are not sector_t
type makes no sense - those are indices in block number arrays, not block numbers. And no, UFS is not likely to grow indirect b
ufs: the offsets ufs_block_to_path() puts into array are not sector_t
type makes no sense - those are indices in block number arrays, not block numbers. And no, UFS is not likely to grow indirect blocks with 4Gpointers in them...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
010d331f |
| 17-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: move truncate code into inode.c
It is closely tied to block pointers handling there, can benefit from existing helpers, etc. - no point keeping them apart.
Trimmed the trailing whitespaces in
ufs: move truncate code into inode.c
It is closely tied to block pointers handling there, can benefit from existing helpers, etc. - no point keeping them apart.
Trimmed the trailing whitespaces in inode.c at the same time.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
724bb09f |
| 17-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: don't use lock_ufs() for block pointers tree protection
* stores to block pointers are under per-inode seqlock (meta_lock) and mutex (truncate_mutex) * fetches of block pointers are either unde
ufs: don't use lock_ufs() for block pointers tree protection
* stores to block pointers are under per-inode seqlock (meta_lock) and mutex (truncate_mutex) * fetches of block pointers are either under truncate_mutex, or wrapped into seqretry loop on meta_lock * all changes of ->i_size are under truncate_mutex and i_mutex * all changes of ->i_lastfrag are under truncate_mutex
It's similar to what ext2 is doing; the main difference is that unlike ext2 we can't rely upon the atomicity of stores into block pointers - on UFS2 they are 64bit. So we can't cut the corner when switching a pointer from NULL to non-NULL as we could in ext2_splice_branch() and need to use meta_lock on all modifications.
We use seqlock where ext2 uses rwlock; ext2 could probably also benefit from such change...
Another non-trivial difference is that with UFS we *cannot* have reader grab truncate_mutex in case of race - it has to keep retrying. That might be possible to change, but not until we lift tail unpacking several levels up in call chain.
After that commit we do *NOT* hold fs-wide serialization on accesses to block pointers anymore. Moreover, lock_ufs() can become a normal mutex now - it's only used on statfs, remount and sync_fs and none of those uses are recursive. As the matter of fact, *now* it can be collapsed with ->s_lock, and be eventually replaced with saner per-cylinder-group spinlocks, but that's a separate story.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
3b7a3a05 |
| 16-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: free excessive blocks upon ->write_begin() failure/short copy
Broken in "[PATCH] ufs: truncate should allocate block for last byte"; all way back in 2006. ufs_setattr() hadn't been the only us
ufs: free excessive blocks upon ->write_begin() failure/short copy
Broken in "[PATCH] ufs: truncate should allocate block for last byte"; all way back in 2006. ufs_setattr() hadn't been the only user of vmtruncate() and eliminating ->truncate() method required corrections in a bunch of places. Eventually those places had migrated into ->write_begin() failure exit and ->write_end() after short copy...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
d622f167 |
| 16-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: switch ufs_evict_inode() to trimmed-down variant of ufs_truncate()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
f3e0f3da |
| 16-Jun-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: kill more lock_ufs() calls
a) move it inside ufs_truncate() b) ufs_free_inode() doesn't need it - it's serialized on ->s_lock c) ufs_write_inode() doesn't need it either (and can be called with
ufs: kill more lock_ufs() calls
a) move it inside ufs_truncate() b) ufs_free_inode() doesn't need it - it's serialized on ->s_lock c) ufs_write_inode() doesn't need it either (and can be called without it anyway).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
13b987ea |
| 09-Jun-2015 |
Fabian Frederick <fabf@skynet.be> |
fs/ufs: revert "ufs: fix deadlocks introduced by sb mutex merge"
This reverts commit 9ef7db7f38d0 ("ufs: fix deadlocks introduced by sb mutex merge") That patch tried to solve commit 0244756edc4b98c
fs/ufs: revert "ufs: fix deadlocks introduced by sb mutex merge"
This reverts commit 9ef7db7f38d0 ("ufs: fix deadlocks introduced by sb mutex merge") That patch tried to solve commit 0244756edc4b98c ("ufs: sb mutex merge + mutex_destroy") which is itself partially reverted due to multiple deadlocks.
Signed-off-by: Fabian Frederick <fabf@skynet.be> Suggested-by: Jan Kara <jack@suse.cz> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Evgeniy Dushistov <dushistov@mail.ru> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Roger Pau Monne <roger.pau@citrix.com> Cc: Ian Jackson <Ian.Jackson@eu.citrix.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
show more ...
|
Revision tags: v4.1-rc6, v4.1-rc5, v4.1-rc4, v4.1-rc3, v4.1-rc2 |
|
#
4b8061a6 |
| 02-May-2015 |
Al Viro <viro@zeniv.linux.org.uk> |
ufs: switch to simple_follow_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
Revision tags: v4.1-rc1, v4.0, v4.0-rc7, v4.0-rc6, v4.0-rc5, v4.0-rc4, v4.0-rc3, v4.0-rc2, v4.0-rc1, v3.19, v3.19-rc7, v3.19-rc6, v3.19-rc5, v3.19-rc4, v3.19-rc3, v3.19-rc2, v3.19-rc1, v3.18, v3.18-rc7, v3.18-rc6, v3.18-rc5, v3.18-rc4, v3.18-rc3, v3.18-rc2, v3.18-rc1, v3.17, v3.17-rc7, v3.17-rc6, v3.17-rc5, v3.17-rc4 |
|
#
9ef7db7f |
| 02-Sep-2014 |
Alexey Khoroshilov <khoroshilov@ispras.ru> |
ufs: fix deadlocks introduced by sb mutex merge
Commit 0244756edc4b ("ufs: sb mutex merge + mutex_destroy") introduces deadlocks in ufs_new_inode() and ufs_free_inode(). Most callers of that functio
ufs: fix deadlocks introduced by sb mutex merge
Commit 0244756edc4b ("ufs: sb mutex merge + mutex_destroy") introduces deadlocks in ufs_new_inode() and ufs_free_inode(). Most callers of that functions acqure the mutex by themselves and ufs_{new,free}_inode() do that via lock_ufs(), i.e we have an unavoidable double lock.
The patch proposes to resolve the issue by making sure that ufs_{new,free}_inode() are not called with the mutex held.
Found by Linux Driver Verification project (linuxtesting.org).
Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
Revision tags: v3.17-rc3, v3.17-rc2, v3.17-rc1 |
|
#
edc023ca |
| 08-Aug-2014 |
Fabian Frederick <fabf@skynet.be> |
fs/ufs/inode.c: kernel-doc warning fixes
Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-of
fs/ufs/inode.c: kernel-doc warning fixes
Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
Revision tags: v3.16, v3.16-rc7, v3.16-rc6, v3.16-rc5, v3.16-rc4, v3.16-rc3, v3.16-rc2, v3.16-rc1, v3.15, v3.15-rc8, v3.15-rc7, v3.15-rc6, v3.15-rc5, v3.15-rc4, v3.15-rc3, v3.15-rc2, v3.15-rc1 |
|
#
91b0abe3 |
| 03-Apr-2014 |
Johannes Weiner <hannes@cmpxchg.org> |
mm + fs: store shadow entries in page cache
Reclaim will be leaving shadow entries in the page cache radix tree upon evicting the real page. As those pages are found from the LRU, an iput() can lea
mm + fs: store shadow entries in page cache
Reclaim will be leaving shadow entries in the page cache radix tree upon evicting the real page. As those pages are found from the LRU, an iput() can lead to the inode being freed concurrently. At this point, reclaim must no longer install shadow pages because the inode freeing code needs to ensure the page tree is really empty.
Add an address_space flag, AS_EXITING, that the inode freeing code sets under the tree lock before doing the final truncate. Reclaim will check for this flag before installing shadow pages.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Rik van Riel <riel@redhat.com> Reviewed-by: Minchan Kim <minchan@kernel.org> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Bob Liu <bob.liu@oracle.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Dave Chinner <david@fromorbit.com> Cc: Greg Thelen <gthelen@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jan Kara <jack@suse.cz> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Luigi Semenzato <semenzato@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Metin Doslu <metin@citusdata.com> Cc: Michel Lespinasse <walken@google.com> Cc: Ozgun Erdogan <ozgun@citusdata.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Roman Gushchin <klamm@yandex-team.ru> Cc: Ryan Mallon <rmallon@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
Revision tags: v3.14, v3.14-rc8, v3.14-rc7, v3.14-rc6, v3.14-rc5, v3.14-rc4, v3.14-rc3, v3.14-rc2, v3.14-rc1, v3.13, v3.13-rc8, v3.13-rc7, v3.13-rc6, v3.13-rc5, v3.13-rc4, v3.13-rc3, v3.13-rc2, v3.13-rc1, v3.12, v3.12-rc7, v3.12-rc6, v3.12-rc5, v3.12-rc4, v3.12-rc3, v3.12-rc2, v3.12-rc1 |
|
#
7caef267 |
| 12-Sep-2013 |
Kirill A. Shutemov <kirill.shutemov@linux.intel.com> |
truncate: drop 'oldsize' truncate_pagecache() parameter
truncate_pagecache() doesn't care about old size since commit cedabed49b39 ("vfs: Fix vmtruncate() regression"). Let's drop it.
Signed-off-b
truncate: drop 'oldsize' truncate_pagecache() parameter
truncate_pagecache() doesn't care about old size since commit cedabed49b39 ("vfs: Fix vmtruncate() regression"). Let's drop it.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|