User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | fs/ubifs/file.c |
Line in file: | 496 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-03-02 21:35:17 UTC |
466 ClearPageError(page); 467 } 468 469 err = allocate_budget(c, page, ui, appending); 470 if (unlikely(err)) { 471 ubifs_assert(err == -ENOSPC); 472 /* 473 * Budgeting failed which means it would have to force 474 * write-back but didn't, because we set the @fast flag in the 475 * request. Write-back cannot be done now, while we have the 476 * page locked, because it would deadlock. Unlock and free 477 * everything and fall-back to slow-path. 478 */ 479 if (appending) { 480 ubifs_assert(mutex_is_locked(&ui->ui_mutex)); 481 mutex_unlock(&ui->ui_mutex); 482 } 483 unlock_page(page); 484 page_cache_release(page); 485 486 return write_begin_slow(mapping, pos, len, pagep); 487 } 488 489 /* 490 * Whee, we aquired budgeting quickly - without involving 491 * garbage-collection, committing or forceing write-back. We return 492 * with @ui->ui_mutex locked if we are appending pages, and unlocked 493 * otherwise. This is an optimization (slightly hacky though). 494 */ 495 *pagep = page; 496 return 0; 497 498} 499 500/** 501 * cancel_budget - cancel budget. 502 * @c: UBIFS file-system description object 503 * @page: page to cancel budget for 504 * @ui: UBIFS inode object the page belongs to 505 * @appending: non-zero if the page is appended 506 *