summaryrefslogtreecommitdiff
path: root/fs/ufs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-06-16 18:45:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-07-06 17:39:28 -0400
commit687857930d9294100a4636e45b78a244e6ba4125 (patch)
treef7929d352818e1d8a8b4cd2b9bcac07dbc92df50 /fs/ufs
parent6a799d3514217d217b4e74a1ee4f016428582dc5 (diff)
ufs: ufs_trunc_...() has exclusion with everything that might cause allocations
Currently - on lock_ufs(), eventually - on per-inode mutex. lock_ufs() used to be mere BKL, which is much weaker, so it needed those rechecks. BKL doesn't provide any exclusion once we lose CPU; its blind replacement, OTOH, _does_. Making that per-filesystem was an atrocity, but at least we can simplify life here. And yes, we certainly need to make that sucker per-inode - these days inode.c and truncate.c uses are needed only to protect the block pointers. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r--fs/ufs/truncate.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index c56f4ef1cb7a..3beaa848e30a 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -195,10 +195,6 @@ static int ufs_trunc_indirect(struct inode *inode, u64 offset, void *p)
if (!tmp)
return 0;
ind_ubh = ubh_bread(sb, tmp, uspi->s_bsize);
- if (tmp != ufs_data_ptr_to_cpu(sb, p)) {
- ubh_brelse (ind_ubh);
- return 1;
- }
if (!ind_ubh) {
write_seqlock(&UFS_I(inode)->meta_lock);
ufs_data_ptr_clear(uspi, p);
@@ -280,10 +276,6 @@ static int ufs_trunc_dindirect(struct inode *inode, u64 offset, void *p)
if (!tmp)
return 0;
dind_bh = ubh_bread(sb, tmp, uspi->s_bsize);
- if (tmp != ufs_data_ptr_to_cpu(sb, p)) {
- ubh_brelse (dind_bh);
- return 1;
- }
if (!dind_bh) {
write_seqlock(&UFS_I(inode)->meta_lock);
ufs_data_ptr_clear(uspi, p);
@@ -345,10 +337,6 @@ static int ufs_trunc_tindirect(struct inode *inode)
if (!(tmp = ufs_data_ptr_to_cpu(sb, p)))
return 0;
tind_bh = ubh_bread (sb, tmp, uspi->s_bsize);
- if (tmp != ufs_data_ptr_to_cpu(sb, p)) {
- ubh_brelse (tind_bh);
- return 1;
- }
if (!tind_bh) {
write_seqlock(&ufsi->meta_lock);
ufs_data_ptr_clear(uspi, p);