aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/gc.c')
-rw-r--r--fs/ubifs/gc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 4fc31ca0e3b1..396f24a30af9 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -242,14 +242,13 @@ int nondata_nodes_cmp(void *priv, struct list_head *a, struct list_head *b)
242static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, 242static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
243 struct list_head *nondata, int *min) 243 struct list_head *nondata, int *min)
244{ 244{
245 int err;
245 struct ubifs_scan_node *snod, *tmp; 246 struct ubifs_scan_node *snod, *tmp;
246 247
247 *min = INT_MAX; 248 *min = INT_MAX;
248 249
249 /* Separate data nodes and non-data nodes */ 250 /* Separate data nodes and non-data nodes */
250 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { 251 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) {
251 int err;
252
253 ubifs_assert(snod->type == UBIFS_INO_NODE || 252 ubifs_assert(snod->type == UBIFS_INO_NODE ||
254 snod->type == UBIFS_DATA_NODE || 253 snod->type == UBIFS_DATA_NODE ||
255 snod->type == UBIFS_DENT_NODE || 254 snod->type == UBIFS_DENT_NODE ||
@@ -293,6 +292,13 @@ static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
293 /* Sort data and non-data nodes */ 292 /* Sort data and non-data nodes */
294 list_sort(c, &sleb->nodes, &data_nodes_cmp); 293 list_sort(c, &sleb->nodes, &data_nodes_cmp);
295 list_sort(c, nondata, &nondata_nodes_cmp); 294 list_sort(c, nondata, &nondata_nodes_cmp);
295
296 err = dbg_check_data_nodes_order(c, &sleb->nodes);
297 if (err)
298 return err;
299 err = dbg_check_nondata_nodes_order(c, nondata);
300 if (err)
301 return err;
296 return 0; 302 return 0;
297} 303}
298 304