Adam Thomas 2928f0d0c5 UBIFS: fix use of freed ubifs_orphan objects
The last orphan in the cnext list has its cnext set to NULL. Because
of that, ubifs_delete_orphan assumes that it is not on the cnext list
and frees it immediately instead of adding it to the dnext list. The
freed orphan is later modified by write_orph_node.

This can cause various inconsistencies including directory entries
that cannot be removed and this error:

UBIFS error (pid 20685): layout_cnodes: LPT out of space at LEB 14:129009 needing 17, done_ltab 1, done_lsave 1

This is a regression introduced by
"7074e5eb UBIFS: remove invalid reference to list iterator variable".

This change adds an explicit flag to ubifs_orphan indicating whether
it is pending commit.

Signed-off-by: Adam Thomas <adamthomas1111@gmail.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org # v3.6+
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2013-02-04 12:31:00 +02:00
..
2012-10-02 20:47:48 -07:00
2012-08-31 17:32:58 +03:00
2012-08-31 17:32:57 +03:00
2012-08-31 17:32:58 +03:00
2012-10-09 16:22:17 +09:00
2012-08-31 17:32:57 +03:00
2012-05-20 20:25:59 +03:00
2012-01-03 22:52:40 -05:00
2012-05-16 19:53:46 +03:00
2012-08-31 17:32:57 +03:00
2012-08-31 17:32:58 +03:00
2012-05-20 20:25:59 +03:00
2011-07-04 10:54:33 +03:00
2012-08-31 17:32:57 +03:00
2012-08-31 17:32:58 +03:00
2012-10-02 20:47:48 -07:00
2012-08-31 17:32:57 +03:00
2012-10-02 20:47:48 -07:00
2012-08-31 17:32:58 +03:00
2012-05-22 19:30:27 -07:00
2012-05-22 19:30:27 -07:00