Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950AbbDLRys (ORCPT ); Sun, 12 Apr 2015 13:54:48 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:34888 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751839AbbDLRyr (ORCPT ); Sun, 12 Apr 2015 13:54:47 -0400 From: Dmitry Monakhov To: Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] pipe: fix race with fcntl In-Reply-To: <20150412173458.GO889@ZenIV.linux.org.uk> References: <1428858502-5371-1-git-send-email-dmonakhov@openvz.org> <1428858502-5371-2-git-send-email-dmonakhov@openvz.org> <20150412173458.GO889@ZenIV.linux.org.uk> User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Sun, 12 Apr 2015 20:52:44 +0300 Message-ID: <87bnitz11v.fsf@openvz.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2444 Lines: 59 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Al Viro writes: > On Sun, Apr 12, 2015 at 09:08:21PM +0400, Dmitry Monakhov wrote: >> Fix other long standing issues caused by fcntl(,F_SETFL,): >> - User can disable O_DIRECT for pipe[1] (paketized IO), but can not enab= le it again. >> - Currently we do not set O_APPEND on pipe[1] (IMHO it is wrong, but let= it be) >> so it is reasonable to completely prohibit change O_APPEND flag on both >> end's of pipe. Add ->check_flags method in order to diallow O_APPEND t= oggling. >>=20 >> Signed-off-by: Dmitry Monakhov >> --- > > TBH, all those ->direct_IO !=3D NULL checks seem to be a wrong approach. > If nothing else, it forces several filesystem into inventing a fake > ->direct_IO just to fool those tests. How about we > * introduce FMODE_MAY_DIRECT and allow ->open() explicitly set it > * make open_check_o_direct() and fcntl.c check that instead of poking > in ->f_mapping->a_ops, etc. > * provide a variant of generic_file_open() that would set that > bit and use it on the filesystems that handle dio 100% agree. FMODE is perfect place for that. BTW: I always wondering: why we do not mark pipe[1]->f_flags with O_APPEND? Probably the answer is that nobody care about ->f_flags since no_llseek returns -ESPIPE, but f_flags are visiable via fcntl so IMHO it is reasonable to fix that too. > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJVKrDsAAoJELhyPTmIL6kBAacIAIxVNn6Z357iINpWxcMjM/FK 0B69ChcaXR9i+stSI5M5P/eWn95MGmmqIFRK4dkeP+KZs4pMxRSEJjlHjDPAKTjd g+5raM/RAB6iH6gTLumSkjkDRWYdp13nbZruaSYFVzRp3vim2JjT0SdL2Gsi/7kU 0TQcKSyf8yiNXSJKyDkL1ey0phy6bTOEJhUjOBTsE6DGM/3q8vg/1K1DtZ3tr2I/ Qa63rEO4rXlZUSSSK5b2e36DsVzBi4QMNRk8zKli+XlRXR7C59NArMFYz+cW+GPG repBk7Q/h/pVrgm7EWAkybvstL458ebs5JeOYKIR85mCnPyLLxmbwiDuSLeYoTw= =A2vb -----END PGP SIGNATURE----- --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/