diff options
-rw-r--r-- | fs/ufs/inode.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 9e409c12afdf..480c34ee1805 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -1091,13 +1091,16 @@ static void ufs_trunc_branch(struct inode *inode, unsigned *offsets, int depth2, | |||
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | if (--depth) { | 1093 | if (--depth) { |
1094 | if (!--depth2) | 1094 | if (offsets && --depth2) { |
1095 | offsets = NULL; | 1095 | void *ind = ubh_get_data_ptr(uspi, ubh, from++); |
1096 | for (i = from ; i < uspi->s_apb ; i++, offsets = NULL) { | ||
1097 | void *ind = ubh_get_data_ptr(uspi, ubh, i); | ||
1098 | ufs_trunc_branch(inode, offsets, depth2, depth, ind); | 1096 | ufs_trunc_branch(inode, offsets, depth2, depth, ind); |
1099 | ubh_mark_buffer_dirty(ubh); | 1097 | ubh_mark_buffer_dirty(ubh); |
1100 | } | 1098 | } |
1099 | for (i = from ; i < uspi->s_apb ; i++) { | ||
1100 | void *ind = ubh_get_data_ptr(uspi, ubh, i); | ||
1101 | ufs_trunc_branch(inode, NULL, 0, depth, ind); | ||
1102 | ubh_mark_buffer_dirty(ubh); | ||
1103 | } | ||
1101 | } else { | 1104 | } else { |
1102 | u64 frag_to_free = 0; | 1105 | u64 frag_to_free = 0; |
1103 | unsigned free_count = 0; | 1106 | unsigned free_count = 0; |