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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 D4287C35249 for ; Sat, 1 Feb 2020 22:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A88212064C for ; Sat, 1 Feb 2020 22:50:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726598AbgBAWuF (ORCPT ); Sat, 1 Feb 2020 17:50:05 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:59123 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726518AbgBAWuF (ORCPT ); Sat, 1 Feb 2020 17:50:05 -0500 Received: from callcc.thunk.org (75-104-86-204.mobility.exede.net [75.104.86.204] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 011MnpV2000422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 1 Feb 2020 17:49:58 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 1A129420324; Sat, 1 Feb 2020 17:49:51 -0500 (EST) Date: Sat, 1 Feb 2020 17:49:51 -0500 From: "Theodore Y. Ts'o" To: qiwuchen55@gmail.com Cc: adilger.kernel@dilger.ca, trivial@kernel.org, linux-ext4@vger.kernel.org, chenqiwu Subject: Re: [PATCH] ext4: remove trivial nowait check for buffered write Message-ID: <20200201224951.GF528198@mit.edu> References: <1580529639-26328-1-git-send-email-qiwuchen55@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1580529639-26328-1-git-send-email-qiwuchen55@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Feb 01, 2020 at 12:00:39PM +0800, qiwuchen55@gmail.com wrote: > From: chenqiwu > > Remove trivial nowait check for ext4_buffered_write_iter(), > since buffered writes will return -EINVAL if IOCB_NOWAIT > passed in the follow-up function ext4_write_checks()-> > ext4_generic_write_checks()->generic_write_checks(). > > Signed-off-by: chenqiwu The reason why we do this check here is so that we return immediately and not potentially block when we call inode_lock(). Otherwise, an AIO request with IOCB_NOWAIT could block, and that's not allowed. - Ted