]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Change lockrestart_do() to always call bch2_trans_begin()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 28 Jul 2021 20:17:10 +0000 (16:17 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:09 +0000 (17:09 -0400)
More consistent behaviour means less likely to trip over ourselves in
silly ways.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update.h

index b5f35a4190045dac3c0cc7e07d51a84d29f36a0c..a1f2d982282117760848c7c1da6c20475d7dd7f8 100644 (file)
@@ -110,12 +110,10 @@ static inline int bch2_trans_commit(struct btree_trans *trans,
 ({                                                                     \
        int _ret;                                                       \
                                                                        \
-       while (1) {                                                     \
-               _ret = (_do);                                           \
-               if (_ret != -EINTR)                                     \
-                       break;                                          \
+       do {                                                            \
                bch2_trans_begin(_trans);                               \
-       }                                                               \
+               _ret = (_do);                                           \
+       } while (_ret == -EINTR);                                       \
                                                                        \
        _ret;                                                           \
 })