Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'upstream-3.5-rc2' of git://git.infradead.org/linux-ubifs

Pull UBI/UBIFS fixes from Artem Bityutskiy:
"Fix UBI and UBIFS - they refuse to work without debugfs. This was
broken by the 3.5-rc1 UBI/UBIFS changes when we removed the debugging
Kconfig switches.

Also, correct locking in 'ubi_wl_flush()' - it was extended to support
flushing a specific LEB in 3.5-rc1, and the locking was sub-optimal."

* tag 'upstream-3.5-rc2' of git://git.infradead.org/linux-ubifs:
UBI: correct ubi_wl_flush locking
UBIFS: fix debugfs-less systems support
UBI: fix debugfs-less systems support

+33 -8
+10 -2
drivers/mtd/ubi/debug.c
··· 264 264 */ 265 265 int ubi_debugfs_init(void) 266 266 { 267 + if (!IS_ENABLED(DEBUG_FS)) 268 + return 0; 269 + 267 270 dfs_rootdir = debugfs_create_dir("ubi", NULL); 268 271 if (IS_ERR_OR_NULL(dfs_rootdir)) { 269 272 int err = dfs_rootdir ? -ENODEV : PTR_ERR(dfs_rootdir); ··· 284 281 */ 285 282 void ubi_debugfs_exit(void) 286 283 { 287 - debugfs_remove(dfs_rootdir); 284 + if (IS_ENABLED(DEBUG_FS)) 285 + debugfs_remove(dfs_rootdir); 288 286 } 289 287 290 288 /* Read an UBI debugfs file */ ··· 407 403 struct dentry *dent; 408 404 struct ubi_debug_info *d = ubi->dbg; 409 405 406 + if (!IS_ENABLED(DEBUG_FS)) 407 + return 0; 408 + 410 409 n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, 411 410 ubi->ubi_num); 412 411 if (n == UBI_DFS_DIR_LEN) { ··· 477 470 */ 478 471 void ubi_debugfs_exit_dev(struct ubi_device *ubi) 479 472 { 480 - debugfs_remove_recursive(ubi->dbg->dfs_dir); 473 + if (IS_ENABLED(DEBUG_FS)) 474 + debugfs_remove_recursive(ubi->dbg->dfs_dir); 481 475 }
+13 -4
drivers/mtd/ubi/wl.c
··· 1262 1262 dbg_wl("flush pending work for LEB %d:%d (%d pending works)", 1263 1263 vol_id, lnum, ubi->works_count); 1264 1264 1265 - down_write(&ubi->work_sem); 1266 1265 while (found) { 1267 1266 struct ubi_work *wrk; 1268 1267 found = 0; 1269 1268 1269 + down_read(&ubi->work_sem); 1270 1270 spin_lock(&ubi->wl_lock); 1271 1271 list_for_each_entry(wrk, &ubi->works, list) { 1272 1272 if ((vol_id == UBI_ALL || wrk->vol_id == vol_id) && ··· 1277 1277 spin_unlock(&ubi->wl_lock); 1278 1278 1279 1279 err = wrk->func(ubi, wrk, 0); 1280 - if (err) 1281 - goto out; 1280 + if (err) { 1281 + up_read(&ubi->work_sem); 1282 + return err; 1283 + } 1284 + 1282 1285 spin_lock(&ubi->wl_lock); 1283 1286 found = 1; 1284 1287 break; 1285 1288 } 1286 1289 } 1287 1290 spin_unlock(&ubi->wl_lock); 1291 + up_read(&ubi->work_sem); 1288 1292 } 1289 1293 1290 - out: 1294 + /* 1295 + * Make sure all the works which have been done in parallel are 1296 + * finished. 1297 + */ 1298 + down_write(&ubi->work_sem); 1291 1299 up_write(&ubi->work_sem); 1300 + 1292 1301 return err; 1293 1302 } 1294 1303
+10 -2
fs/ubifs/debug.c
··· 2918 2918 struct dentry *dent; 2919 2919 struct ubifs_debug_info *d = c->dbg; 2920 2920 2921 + if (!IS_ENABLED(DEBUG_FS)) 2922 + return 0; 2923 + 2921 2924 n = snprintf(d->dfs_dir_name, UBIFS_DFS_DIR_LEN + 1, UBIFS_DFS_DIR_NAME, 2922 2925 c->vi.ubi_num, c->vi.vol_id); 2923 2926 if (n == UBIFS_DFS_DIR_LEN) { ··· 3013 3010 */ 3014 3011 void dbg_debugfs_exit_fs(struct ubifs_info *c) 3015 3012 { 3016 - debugfs_remove_recursive(c->dbg->dfs_dir); 3013 + if (IS_ENABLED(DEBUG_FS)) 3014 + debugfs_remove_recursive(c->dbg->dfs_dir); 3017 3015 } 3018 3016 3019 3017 struct ubifs_global_debug_info ubifs_dbg; ··· 3099 3095 const char *fname; 3100 3096 struct dentry *dent; 3101 3097 3098 + if (!IS_ENABLED(DEBUG_FS)) 3099 + return 0; 3100 + 3102 3101 fname = "ubifs"; 3103 3102 dent = debugfs_create_dir(fname, NULL); 3104 3103 if (IS_ERR_OR_NULL(dent)) ··· 3166 3159 */ 3167 3160 void dbg_debugfs_exit(void) 3168 3161 { 3169 - debugfs_remove_recursive(dfs_rootdir); 3162 + if (IS_ENABLED(DEBUG_FS)) 3163 + debugfs_remove_recursive(dfs_rootdir); 3170 3164 } 3171 3165 3172 3166 /**