Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp50690imm; Tue, 25 Sep 2018 15:46:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV63PRSpSi+/3mU5+xsYQm1a0wmtiMmoBWTTJz1x98R6ZWL7qYfHhrhDBSyoSu8ZrXlabds4R X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr2901975pgj.356.1537915614474; Tue, 25 Sep 2018 15:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537915614; cv=none; d=google.com; s=arc-20160816; b=Y+IUGH85O5TdyOfjc174fb0gVgYDJ38BHwQygYI6ZMe11wEtlZgrBw+Kvg0/5OStvv gr7ZkOHIIlDKB8KNDF1OfgfhzaX4fFo/Fqm5bGCVVzDwwV8/3TImMBahDsTitUIHDh/t ORxcSkiplT7MAdS81Lt7scKLd1JEGVjb1Evqr7COzSFlg+sSDhasm7JhbP+9shBN/TkP CiD56A2vOSg4M6LopI6Vr9NOUrJkZSnJqkLrjoc6uw42eE6NuciN9Xat8SiUk11C1WmG I5KhGHI+sDPVkbA745nQ/wjey0xOpAz4F0lSW/fWX10M+4gME8Q0Ur2iOkS9yOo1p2tP RS2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=1AKVkItclCGHEaCR5sP1WIq8GkjW7eekSl1fEgXo504=; b=eKlhP/fONrZFvfDB381NL75HQTMAGF4uKhxOTCKHdXDxicW5CfZzYUb/gD/bu6ckgF /vkidEOXKPUM85RmZtcdZJlGpE/sMCjH4OUMuluqPLeoegKQy9VCRhXI1xHFofknOgrV 9F8yEPEcI+Qxcejdv7a22HBIczScEt/Ri9CcDrU3fPlxVUoSLFL4RBnaXvWBJD4B5MDS i4gifIwgJfQ1pwrvmax+69i9r46BhijIF+5ZcmlxjXqzifWaVCou9NKjQyvEJ6OJeFe7 283C5qy2sEgWyOdH3x2+20osZKBIiElF0Mm3AbMvqz6JxUgKjQJyUUaPT121628EiGmE XJww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=kfQ89CHM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si3543090pla.436.2018.09.25.15.46.24; Tue, 25 Sep 2018 15:46:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=kfQ89CHM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726248AbeIZE4G (ORCPT + 99 others); Wed, 26 Sep 2018 00:56:06 -0400 Received: from imap.thunk.org ([74.207.234.97]:47276 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725762AbeIZE4G (ORCPT ); Wed, 26 Sep 2018 00:56:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1AKVkItclCGHEaCR5sP1WIq8GkjW7eekSl1fEgXo504=; b=kfQ89CHMQy7PuBPUE7PDvCjqI8 hpNB7+SzgcYXTqP3X3wLqj5tmGhthKC5EylluDbmtbuJu5+afOc9iHfZlMqoXKlvXJMX5EDFFg+Sv WTm72ecZ5E08ljJtJjXdB7HJoTyxYT82w2q2rDRjyP5BUdqR6j+fHdBQS/WYEDPtrNdg=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1g4w5u-0004B2-5F; Tue, 25 Sep 2018 22:46:14 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 67CC67A54D5; Tue, 25 Sep 2018 18:46:13 -0400 (EDT) Date: Tue, 25 Sep 2018 18:46:13 -0400 From: "Theodore Y. Ts'o" To: Adam Borowski Cc: Jeff Layton , Alan Cox , =?utf-8?B?54Sm5pmT5Yas?= , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Rogier Wolff Subject: Re: POSIX violation by writeback error Message-ID: <20180925224613.GI2933@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Adam Borowski , Jeff Layton , Alan Cox , =?utf-8?B?54Sm5pmT5Yas?= , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Rogier Wolff References: <486f6105fd4076c1af67dae7fdfe6826019f7ff4.camel@redhat.com> <20180925003044.239531c7@alans-desktop> <0662a4c5d2e164d651a6a116d06da380f317100f.camel@redhat.com> <20180925154627.GC2933@thunk.org> <20180925173510.273hshp4iapd6dcd@angband.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180925173510.273hshp4iapd6dcd@angband.pl> User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2018 at 07:35:11PM +0200, Adam Borowski wrote: > Isn't this what the snippet for O_TMPFILE in "man 2 open" does?: > > char path[PATH_MAX]; > fd = open("/path/to/dir", O_TMPFILE | O_RDWR, > S_IRUSR | S_IWUSR); > > /* File I/O on 'fd'... */ > > snprintf(path, PATH_MAX, "/proc/self/fd/%d", fd); > linkat(AT_FDCWD, path, AT_FDCWD, "/path/for/file", > AT_SYMLINK_FOLLOW); Huh. I stand corrected. I had assumed O_TMPFILE worked like any other file where the link count was zero, and linkat(2) wouldn't allow this. But obviously, this does work. In fact, from the linkat(2) man page, using: linkat(fd, NULL, AT_FDCWD, "/path/for/file", AT_EMPTY_PATH); is an even simpler way that doesn't /proc being mounted. TIL... - Ted