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

Btrfs: catch errors from btrfs_sync_log

btrfs_sync_log returns -EAGAIN when we need full transaction commits
instead of small log commits, but sometimes we were dropping the return
value.

In practice, we check for this a few different ways, but this is still a
bug that can leave off full log commits when we really need them.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

+2 -1
+2 -1
fs/btrfs/tree-log.c
··· 2051 2051 wait_log_commit(trans, log_root_tree, 2052 2052 log_root_tree->log_transid); 2053 2053 mutex_unlock(&log_root_tree->log_mutex); 2054 + ret = 0; 2054 2055 goto out; 2055 2056 } 2056 2057 atomic_set(&log_root_tree->log_commit[index2], 1); ··· 2116 2115 smp_mb(); 2117 2116 if (waitqueue_active(&root->log_commit_wait[index1])) 2118 2117 wake_up(&root->log_commit_wait[index1]); 2119 - return 0; 2118 + return ret; 2120 2119 } 2121 2120 2122 2121 static void free_log_tree(struct btrfs_trans_handle *trans,