diff options
Diffstat (limited to 'fs/ubifs/gc.c')
-rw-r--r-- | fs/ubifs/gc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index b2e5f1133377..9760154d874b 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c | |||
@@ -830,21 +830,29 @@ out: | |||
830 | * ubifs_destroy_idx_gc - destroy idx_gc list. | 830 | * ubifs_destroy_idx_gc - destroy idx_gc list. |
831 | * @c: UBIFS file-system description object | 831 | * @c: UBIFS file-system description object |
832 | * | 832 | * |
833 | * This function destroys the idx_gc list. It is called when unmounting or | 833 | * This function destroys the @c->idx_gc list. It is called when unmounting or |
834 | * remounting read-only so locks are not needed. | 834 | * remounting read-only so locks are not needed. Returns zero in case of |
835 | * success and a negative error code in case of failure. | ||
835 | */ | 836 | */ |
836 | void ubifs_destroy_idx_gc(struct ubifs_info *c) | 837 | int ubifs_destroy_idx_gc(struct ubifs_info *c) |
837 | { | 838 | { |
839 | int ret = 0; | ||
840 | |||
838 | while (!list_empty(&c->idx_gc)) { | 841 | while (!list_empty(&c->idx_gc)) { |
842 | int err; | ||
839 | struct ubifs_gced_idx_leb *idx_gc; | 843 | struct ubifs_gced_idx_leb *idx_gc; |
840 | 844 | ||
841 | idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, | 845 | idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, |
842 | list); | 846 | list); |
843 | c->idx_gc_cnt -= 1; | 847 | err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC, |
848 | LPROPS_NC, 0, LPROPS_TAKEN, -1); | ||
849 | if (err && !ret) | ||
850 | ret = err; | ||
844 | list_del(&idx_gc->list); | 851 | list_del(&idx_gc->list); |
845 | kfree(idx_gc); | 852 | kfree(idx_gc); |
846 | } | 853 | } |
847 | 854 | ||
855 | return ret; | ||
848 | } | 856 | } |
849 | 857 | ||
850 | /** | 858 | /** |