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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E00DC433E6 for ; Wed, 20 Jan 2021 16:29:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A33B233EE for ; Wed, 20 Jan 2021 16:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391398AbhATQ2x (ORCPT ); Wed, 20 Jan 2021 11:28:53 -0500 Received: from verein.lst.de ([213.95.11.211]:56613 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404036AbhATQ2v (ORCPT ); Wed, 20 Jan 2021 11:28:51 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id F2B6768B02; Wed, 20 Jan 2021 17:28:06 +0100 (CET) Date: Wed, 20 Jan 2021 17:28:06 +0100 From: Christoph Hellwig To: Raphael Carvalho Cc: Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, avi@scylladb.com, Dave Chinner , Brian Foster Subject: Re: [PATCH 02/11] xfs: make xfs_file_aio_write_checks IOCB_NOWAIT-aware Message-ID: <20210120162806.GA20331@lst.de> References: <20210118193516.2915706-1-hch@lst.de> <20210118193516.2915706-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Tue, Jan 19, 2021 at 09:33:37AM -0300, Raphael Carvalho wrote: > > * No fallback to buffered IO after short writes for XFS, direct > > I/O > > @@ -632,7 +648,8 @@ xfs_file_dax_write( > > error = xfs_setfilesize(ip, pos, ret); > > } > > out: > > - xfs_iunlock(ip, iolock); > > + if (iolock) > > + xfs_iunlock(ip, iolock); > > > > Not familiar with the code but looks like you're setting *iolock to zero on > error and perhaps you want to dereference it here instead In this function iolock is a scalar value, not a pointer. xfs_file_aio_write_checks gets it passed by reference and clears it, and here we check that the iolock is locked at all.