Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp222102imi; Thu, 21 Jul 2022 20:07:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcVoofoFHA5/LQY1Z+VjS50VdAu89EU57Y7PmxxgShHoUvVvMGEcdW9XoHTlYDPP5oAk+O X-Received: by 2002:a05:6870:170d:b0:10d:758b:8050 with SMTP id h13-20020a056870170d00b0010d758b8050mr671158oae.116.1658459262940; Thu, 21 Jul 2022 20:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658459262; cv=none; d=google.com; s=arc-20160816; b=hnAZq2t2MWPTviNe0aCi0E+AkWbEY6QdQgtgJrouaX8h56lnw3Vz7KG2R6/tiRG73R x56Lt0uRGxfhAL5HaxyDvAjrZF0vWs39Ebh66P43+MOeYhWBrMEYtPXzNCF9zTExWzOf N39nRL5vC2JvUtkQ3eapML8J06P7f1jxcyZo7xrAjuk1brJDjZ6nvzIyYLMI3MLnRnQp HripqqofeuOqB0tmr45fj9Nq2VLvDkhwiLu6Y8dCXxnzX9vT9AX317VboqwpdL+Dq4re Zw5SSfMpJ/W0IhcwoCbASHoqekIlnswhwtnW1Y/eU5FMxlMbUo4jXgpDsU7NqR+ybMjb xpgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5gKwZLxMeL1yhX3pqtPWqc9UZF7xh1iyGoTNldl9jco=; b=RxWccgE6OFbAjM4jTXokk0IAc/tKWXiSG6DojC8yXq3nEGptVuFXTLLFpnbCyPOzI7 PC/MD9Pi48vIgbt4L2clHotWWeOg1mjeGuf2bzUglmj2nlMYkmDzmPEqBfUNDj7M9jE4 8PX8vpbX1+7EyjweM5L4Ajqlsdh1eUscYzyraZ3hIbUPSqfv+cgvpPbWhmDq9E3cuLhv HsBIQSJerHicldD+xbOaqV+K2XNwl+7b6Ix4MHtkTlkgUQ6jFgrbQg3v/8JYoYC3V/3j KO8GnB6e9big+SUi830rcphmgUbtzDEryscLrhRI7J9pmssLmR5XnkNpxN1ZN/cezSTX Hd3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=NdrM1vt0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s65-20020aca5e44000000b00337dba81e9fsi2703834oib.275.2022.07.21.20.06.44; Thu, 21 Jul 2022 20:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=NdrM1vt0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233884AbiGVDFh (ORCPT + 99 others); Thu, 21 Jul 2022 23:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233887AbiGVDFd (ORCPT ); Thu, 21 Jul 2022 23:05:33 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8E1237C5 for ; Thu, 21 Jul 2022 20:05:31 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 26M35NtR027951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Jul 2022 23:05:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1658459125; bh=5gKwZLxMeL1yhX3pqtPWqc9UZF7xh1iyGoTNldl9jco=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=NdrM1vt0j/aTnZS31dY63i0+541RMkgMdgKFzwWZFfZe5bug6kYLrBnZ0cVnI8c8D OCpnQB9wcfFcr7ZBHe8Rjmb9NHE5Vn94hbF0k5Z4c0O96d1+QoX4sdHCVzJaDJ4nwt JG9Qe1+Bm3IU43qQDve4TIBFDdfUQkQx2oZkdmQMlvzFGESh7Tj/Q9vC1yCGbgY7bJ YyTKbIF3SHk9pawsM7WgMOqM0JHvT7kYFlQXMPyPA1OLtNmTrOUYa5qiL21h0jyVsJ 8AZhoIDqFbx8rSnHMeCKmzB19loJVluFBZOOgI2uVZ5fZgYhg8qnsYuHgEt46tQ/zx XZWZGGLzD0xtQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id C596C15C3EBF; Thu, 21 Jul 2022 23:05:23 -0400 (EDT) Date: Thu, 21 Jul 2022 23:05:23 -0400 From: "Theodore Ts'o" To: Eric Whitney Cc: Jan Kara , linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: minor defrag code improvements Message-ID: References: <20220621143340.2268087-1-enwlinux@gmail.com> <20220714115326.qhjsrchoepnnsffu@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jul 20, 2022 at 11:11:38AM -0400, Eric Whitney wrote: > > Is ETXTBUSY still reported by the kernel? I couldn't find it in a search after > > reading this: lwn.net/Articles/866493/ > > I didn't consider that because an executable wasn't involved - interesting that > > it was used for some operations applied to swap files. The LWN article is specifically about whether it's worth it to block writes to executable files. However, if you look at some places where ETXTBSY is returned, such as in fs/open.c and fs/read_write.c, it's being returned when there is attempt to operate on a swap file using fallocate(2), write(2) or copy_file(2). So I agree with Jan that it's better for the defrag code to be consistent those uses of ETXTBSY. I'll also add that, "busy" does make some sense as a concept, since if you run "swapoff", you can now defrag the file, since it's no longer being used as a swap file --- hence, it's no longer busy. So I don't have as visceral reaction to using EBUSY, but given the other ways defrag might return EBUSY where it *would* make sense to retry the defrag, I agree that changing the error return in the case of an attempted defrag of a swap file to ETXTBSY makes sense. - Ted