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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8693C678D5 for ; Wed, 22 Feb 2023 14:39:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbjBVOjY (ORCPT ); Wed, 22 Feb 2023 09:39:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231801AbjBVOjW (ORCPT ); Wed, 22 Feb 2023 09:39:22 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B5434F58 for ; Wed, 22 Feb 2023 06:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5qYYj3R++UTH/LIXl5f8G4boIMW4J5zVgj/HdKAkWo0=; b=lrwoq4fwvCO4Xkddm9vWp+PQXy hhskRie+gEJzNyhC0e9j2rwjRCREyvzpsVwDyxCLXIWVGwkjH3e2cK60+yuAHXVkcU/48Gi+RjOoa Dg1CwSJm31XGnN10G4Zys15DjqofGlqpr6OsdVSZQnsH/jgnyobfg9g7SlkZV5l41+F5GjxiYMVHN 6ITkKWbs8TX/Hp5qtIKzQBBPdjEFK2X+6Om2+fKH3RULkctsKhib2roZyZmzWA/2nziGD+hWQEITf I03N5fxsqis2oUiF0DVAbzLDDZxEsOCaQ0Y2Ep5kKzXISZD/l81bvXfhRj7p+PHBqWQ9Lrv8WNyD9 60UqpbkQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUqH9-00ChsI-LM; Wed, 22 Feb 2023 14:39:19 +0000 Date: Wed, 22 Feb 2023 06:39:19 -0800 From: Christoph Hellwig To: Filipe Manana Cc: Boris Burkov , linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2 2/2] btrfs: fix dio continue after short write due to buffer page fault Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, Feb 22, 2023 at 11:51:44AM +0000, Filipe Manana wrote: > > ssize_t btrfs_dio_read(struct kiocb *iocb, struct iov_iter *iter, size_t done_before) > > { > > - struct btrfs_dio_data data; > > + struct btrfs_dio_data data = { }; > > Btw, everywhere else we use the { 0 } style, so we should, ideally, be > consistent and use it here too. The empty initializer is just a newer C feature that hasn't caught on everywhere yet. It has the advantage of not creating a compile failure when a new first member gets added that can't be assigned to (or a sparse warning when it is a pointer). It has not downsides over the 0 initializer and should be used everywhere eventually.