From owner-freebsd-fs@freebsd.org Sun May 13 18:41:32 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4410FCB866 for ; Sun, 13 May 2018 18:41:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5BA4986252 for ; Sun, 13 May 2018 18:41:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 1B3E8FCB865; Sun, 13 May 2018 18:41:32 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 077E9FCB861 for ; Sun, 13 May 2018 18:41:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5448622B for ; Sun, 13 May 2018 18:41:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w4DIfKfe055110 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 13 May 2018 21:41:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4DIfKfe055110 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4DIfKZp055109; Sun, 13 May 2018 21:41:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 13 May 2018 21:41:20 +0300 From: Konstantin Belousov To: Ryan Stone Cc: "freebsd-fs@freebsd.org" Subject: Re: "NFS append race" Message-ID: <20180513184120.GY6887@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2018 18:41:32 -0000 On Sun, May 13, 2018 at 11:07:05AM -0400, Ryan Stone wrote: > I have a 11.1-RELEASE client mounting an NFS directory from a > 12-CURRENT server. I'm doing a buildworld right now on it, with the > src dir mounted on a local drive on the client and the objdir on the > NFS mount. I'm seeing the following printed to the console every few > minutes: > > > NFS append race @10000:4040 > NFS append race @10000:4040 > NFS append race @10000:564 > NFS append race @10000:564 > > > The "10000" is never changes, but the number after the : is always > different (except that the exact same message will repeat once within > a second of the first message) > > What does this mean? Is it something to be concerned about? I remember that nfsiods threads do not lock the vnode when performing the async io. This seems to be the most feasible explanation for the race. Basically, kernel tracks the dirty regions in the buffers, and apparently the append write covers less region that the currently recorder dirty region. If truncation occured while there is still a scheduled nfsiod write, then the write would re-dirty the truncated range. I suspect that this is mostly innocent. Of course, we should start locking the vnodes in nfsiod.