If we have any chance to make a successful write, we should not give up.
This patch adjust commit-transaction condition from:
  pinned >= wanted
to
  left + pinned >= wanted
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
                 * don't bother committing the transaction.
                 */
                if (percpu_counter_compare(&data_sinfo->total_bytes_pinned,
-                                          bytes) < 0)
+                                          used + bytes -
+                                          data_sinfo->total_bytes) < 0)
                        have_pinned_space = 0;
                spin_unlock(&data_sinfo->lock);