From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:37825 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbeFEMNL (ORCPT ); Tue, 5 Jun 2018 08:13:11 -0400 Date: Tue, 5 Jun 2018 14:10:24 +0200 From: David Sterba To: Andreas Gruenbacher Cc: cluster-devel@redhat.com, Christoph Hellwig , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v8 03/10] iomap: Complete partial direct I/O writes synchronously Message-ID: <20180605121024.t6indzioavvfonxk@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20180604193123.27655-1-agruenba@redhat.com> <20180604193123.27655-4-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180604193123.27655-4-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jun 04, 2018 at 09:31:16PM +0200, Andreas Gruenbacher wrote: > @@ -1062,8 +1063,9 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, > if (ret < 0) > iomap_dio_set_error(dio, ret); > > + smp_mb__before_atomic(); > if (!atomic_dec_and_test(&dio->ref)) { The barrier should be documented. I tried to do a quick look around the code if it's clear why it's there but it's not. Thanks. > - if (!is_sync_kiocb(iocb)) > + if (!dio->wait_for_completion) > return -EIOCBQUEUED; > > for (;;) {