From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78443C433F5 for ; Mon, 10 Oct 2022 10:04:57 +0000 (UTC) Received: from localhost ([::1]:42854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohpea-0003Wk-CN for qemu-devel@archiver.kernel.org; Mon, 10 Oct 2022 06:04:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohpWP-0004Mw-BA for qemu-devel@nongnu.org; Mon, 10 Oct 2022 05:56:29 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:40470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohpWN-00081s-LG for qemu-devel@nongnu.org; Mon, 10 Oct 2022 05:56:28 -0400 Received: by mail-pj1-x1035.google.com with SMTP id g8-20020a17090a128800b0020c79f987ceso4851757pja.5 for ; Mon, 10 Oct 2022 02:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5mN/0Fi6tkYvVOJNxQhuxM6pdBRIwOkZ2fDQltQOYuE=; b=QuUCMNL97eq5X2IjVt8hxD7QH6simE/9jwAK6qBWqoBIwO1cBzgVOaEHTW+yHHfxGb zuEUgd6V8xxFkuN+GPxn3mpglkdSUs64fE+bi2akf/Mo4wv6tsJhUQchPZDMzuquIvJv qAQvOiWc3NrF1YUmFt7inWNmkXPY21LVqg6/ZRo2MXIKYZxHtRJm3N54Uqb6RBF92fnj 5ObpzGwt9HA78k7uAYr8MynU9Z6FXAC0ggPFzTMwlSwtz8Moup8XRX1+RP0vUSO3v/jC LrzTG9U90QhPXoST3YQCBhCE6MrOwBx/T+0pItN6gwgunUUC24BSsEqNjbI5H+zCmPt+ l5AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5mN/0Fi6tkYvVOJNxQhuxM6pdBRIwOkZ2fDQltQOYuE=; b=iBzv7oihvmrtsKFELLV4LPccRjqA9X+UkK6jdqw/ceudZZjCyQY2DWPP4Xu6lEdVoj T8OY8GMVZNtDvyvpPzHm1dHYiEXgdQ+wcuPyRbx8gtxyBAzXSn+ApWaQR/p+uT2FHgul PMVK939QWXeEbRsbpgHY62baVcOHCLtCTUDfydQA/5pgMk1Jx32XG80vYfulzZSWmbce WlWCloZvX/R1kis3SM0st92CsWzMZk2WNOq9zQ9uFfDNpWA3Zg8E6lMyalRSV1q+ZLuA 0plzpjJQyRg56ABxM2gvoCGSUTFIyT8eFYHmk/UcRmZB5qRJN67TSgH7tVJsuonMzTEi IqdA== X-Gm-Message-State: ACrzQf3s5xiE9YkLvboJg4Rcn6b61wVvGfzmDTAirY3ede5A5onVEKhm jHAp/wYLWtICUR8P3G8819olFmS+MCZ9e5OQGRpqnQ== X-Google-Smtp-Source: AMsMyM62tofb79nUaltnPUoq2tgJqUCIfQL5dOcAua1K6q8nm6Cso/DcsHSJ9jiREgbPvUGUPQWI0VJycVbbQEooKnQ= X-Received: by 2002:a17:902:aa8b:b0:178:8f1d:6936 with SMTP id d11-20020a170902aa8b00b001788f1d6936mr18373213plr.168.1665395786032; Mon, 10 Oct 2022 02:56:26 -0700 (PDT) MIME-Version: 1.0 References: <1727925.InMztqvFxb@silver> In-Reply-To: From: Peter Maydell Date: Mon, 10 Oct 2022 10:56:14 +0100 Message-ID: Subject: Re: [PATCH] error handling: Use TFR() macro where applicable To: Nikita Ivanov Cc: Christian Schoenebeck , qemu-devel@nongnu.org, Markus Armbruster , =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , Greg Kurz , Jason Wang , Michael Roth , Konstantin Kostiuk , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=peter.maydell@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 10 Oct 2022 at 09:34, Nikita Ivanov wrote: > > Hi! Thanks for your notes. I'll try to send updated patches by the end of the day. > > On Fri, Oct 7, 2022 at 6:32 PM Peter Maydell wrote: >> I'm not sure why you've put the TEMP_FAILURE_RETRY on the outside here >> rather than just on the individual function calls. > > > The original code contained both branches in one while loop, so I was afraid that > value `aiocb->aio_type & QEMU_AIO_WRITE` would change somehow during the loop. > If you'll say that this is impossible, I'll adjust the code as you propose. Oh, yes, I see. No, nothing should be changing that during the loop, I think it's just written the way it is now because it seemed neater when you write out the retry longhand. -- PMM