diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-18 22:13:56 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-06 23:39:43 +0200 |
commit | a96574233c5d2e50736d83abf65161ec5fa55852 (patch) | |
tree | ccc9863f01a2dc3028aa60994bd5b09a5b0e8a00 /fs/ufs | |
parent | ufs_trunc_branch(): never call with offsets != NULL && depth2 == 0 (diff) | |
download | linux-a96574233c5d2e50736d83abf65161ec5fa55852.tar.xz linux-a96574233c5d2e50736d83abf65161ec5fa55852.zip |
ufs_trunc_branch(): separate the calls with non-NULL offsets
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-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, } if (--depth) { - if (!--depth2) - offsets = NULL; - for (i = from ; i < uspi->s_apb ; i++, offsets = NULL) { - void *ind = ubh_get_data_ptr(uspi, ubh, i); + if (offsets && --depth2) { + void *ind = ubh_get_data_ptr(uspi, ubh, from++); ufs_trunc_branch(inode, offsets, depth2, depth, ind); ubh_mark_buffer_dirty(ubh); } + for (i = from ; i < uspi->s_apb ; i++) { + void *ind = ubh_get_data_ptr(uspi, ubh, i); + ufs_trunc_branch(inode, NULL, 0, depth, ind); + ubh_mark_buffer_dirty(ubh); + } } else { u64 frag_to_free = 0; unsigned free_count = 0; |