From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 342192E3EE for ; Fri, 22 Nov 2024 16:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732292153; cv=none; b=Filw3BD1iIYfjf9S1DLmtCIcoqep9HhdF9FIEWFXqWhlHYdPp2OkjZBOujrmw5N3/Sqr+H97F7nm+N/jjm6VX2/8wUVT+n6HvTcKHMbR5swzpz1FvY40qhRo2oK5FJOh/wllU6INxUGQ1Qwmnyvgt3ROaIjwPjfSVhch3tTcmog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732292153; c=relaxed/simple; bh=KdgWj/RXcHE+e9GGjubpHo52Z8xGw21nUc0Wb4ymvd4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fvAzaloMbg7REt4bW2gLdl7eP8fzJeXdo5c2jqhYAZxEVBK9MkN0qEsFRn2IYX5lu1G6P4KaIZmBu4P4zmYgw4WO8fSkewS/W0LAWO3hwn8xkmgsvfvNZnjQA8vMBzTBnMBai+pjTxedmkWl6ppV+6hT5PCvXlWB0fF4y6dvYXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 1B2F868C7B; Fri, 22 Nov 2024 17:15:48 +0100 (CET) Date: Fri, 22 Nov 2024 17:15:47 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Al Viro , Christian Brauner , Jens Axboe , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/2] fs: require FMODE_WRITE for F_SET_RW_HINT Message-ID: <20241122161547.GA7787@lst.de> References: <20241122122931.90408-1-hch@lst.de> <20241122122931.90408-3-hch@lst.de> <20241122125342.vmmjokiilvnuifuf@quack3> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241122125342.vmmjokiilvnuifuf@quack3> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Nov 22, 2024 at 01:53:42PM +0100, Jan Kara wrote: > Here I'm not so sure. Firstly, since you are an owner this doesn't add any > additional practical restriction. Secondly, you are not changing anything > on disk, just IO hints in memory... Thirdly, we generally don't require > writeable fd even to do file attribute changes (like with fchmod, fchown, > etc.). So although the check makes some sense, it seems to be mostly > inconsistent with how we treat similar stuff. As I said I'm not quite convince either, so just doing the first one is probably fine.