Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp941089rda; Sun, 22 Oct 2023 17:56:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKqGWJNIvmdj03ieVDZAiK0AnHaCK+6d9RSF6xzxWAvNvrxC0CHZFfa3pK70KAI5oeWp7z X-Received: by 2002:a17:903:1c1:b0:1ca:e6c6:92f6 with SMTP id e1-20020a17090301c100b001cae6c692f6mr2175616plh.9.1698022594905; Sun, 22 Oct 2023 17:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698022594; cv=none; d=google.com; s=arc-20160816; b=rjZMGgEwpmQOln8vcW9jqBg9w/KRN+XDj6zkPDDlOIB8Xp9j0N0e/Pnrc/dQ5X7mgn /KHakBi8QGvgyjf63hCGISSdmyx9o1h92rHuZbXfWXM4RaxbJDV461rWWNW4VcfMOGt5 MRNgagR0PIUxw++ULIP/viTsi0Bl6sHhAOZpE1DZES7h7wR+Rn3X35g5nt7DisK+eYYf Rjxem4jvlVeD+BsxX6cimVmo+U2RAnswd1N8U6vuDTk9FriyNsQ6QeEY4l0lF5ZSWig6 4BKu5kL7bJPrIQsxgnvUEfim+DLxrIGty2mWnnSvQFOs4bsUACkudkp6v/HgYPY+F9qc 74TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f+wjiy84HCg2u0espIbpZnSTYmmEmGm8HjpTfiuYtvI=; fh=yuRramhGq0WL2K5UzSHbmBUqFwkKKsxJy2e+kdMaUuc=; b=iGF90MVDuUhIGO3jKAlUWqSUvBQAG3FeQX64UdBWk74oa1iSLMofDH2t6yCsNeYFrx 1+I+8SSUv7fjQI9n3e8H+5iogkJZkKvA9AwLgW0kOzAdS1UcCSPheJOV8kkhz76OXOO2 jgWeqijIMQ544AXvb+SfjgS9TSj8P45T+8RIyQCsK5B8yREQUOsgx2iTwV8lagpxJcuN 1zJPa0b03sjgvg0ztDUZ8mRrkoqniMaxMUwRKP2UNAUsXxJ98cQnmXR7Becvu3in+Qkz LhTRPUOo3BGaaKskAQiRJsOL4Bc6J63HtS1UTPSTyOFb+TzdNFjltivoAYEU+ZQqSzwA N13g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=nc+FdK25; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e7-20020a170902744700b001c9c967e77esi5161816plt.207.2023.10.22.17.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 17:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=nc+FdK25; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 825DA8070D9F; Sun, 22 Oct 2023 17:55:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229446AbjJWAzw (ORCPT + 99 others); Sun, 22 Oct 2023 20:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232844AbjJWAzv (ORCPT ); Sun, 22 Oct 2023 20:55:51 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 133E2B7 for ; Sun, 22 Oct 2023 17:55:48 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-111-143.bstnma.fios.verizon.net [173.48.111.143]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 39N0tUrG027576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 22 Oct 2023 20:55:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1698022532; bh=f+wjiy84HCg2u0espIbpZnSTYmmEmGm8HjpTfiuYtvI=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type; b=nc+FdK25C5hrOc6JwLCwICdGHuWAKRaF1IhgHWoiThpVUqqB6UoZSIqUkrfge8oMP 4IgNP9qakMtQjv8TNMU4KtseNIAtz31S160hfFJJkWw97CQFdHDmEXfZ65r1EF9fzd gbQMfhndcvpejMy7aR50w+R6+S5KBxcbFPpmGwRbooNtIHu8MxPO647BKWle9BNAsl ciiG52sPxdwtPRBWJqQcklCrWxbx1KUVBeuh6upnoWrg6plVm/ZsgnfuqSW2GCOeNs fTQBPSp/NvWioVz/Ul/ylqd5Ez8lAth7ZpHOtt1ATfiNUtcylAXwx2ggIo8gVGELID r4onIotiXoZsQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 8781315C0247; Sun, 22 Oct 2023 20:55:30 -0400 (EDT) From: "Theodore Ts'o" To: Jan Kara Cc: "Theodore Ts'o" , linux-ext4@vger.kernel.org, "Ritesh Harjani (IBM)" , Dave Chinner , stable@vger.kernel.org, Gao Xiang Subject: Re: [PATCH v3] ext4: Properly sync file size update after O_SYNC direct IO Date: Sun, 22 Oct 2023 20:55:29 -0400 Message-Id: <169802252287.2300216.15136208439429495793.b4-ty@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20231013121350.26872-1-jack@suse.cz> References: <20231013121350.26872-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 22 Oct 2023 17:55:54 -0700 (PDT) On Fri, 13 Oct 2023 14:13:50 +0200, Jan Kara wrote: > Gao Xiang has reported that on ext4 O_SYNC direct IO does not properly > sync file size update and thus if we crash at unfortunate moment, the > file can have smaller size although O_SYNC IO has reported successful > completion. The problem happens because update of on-disk inode size is > handled in ext4_dio_write_iter() *after* iomap_dio_rw() (and thus > dio_complete() in particular) has returned and generic_file_sync() gets > called by dio_complete(). Fix the problem by handling on-disk inode size > update directly in our ->end_io completion handler. > > [...] Applied, thanks! [1/1] ext4: Properly sync file size update after O_SYNC direct IO commit: c388da1dad59dc24801b61bc63539cab6cd83e23 Best regards, -- Theodore Ts'o