Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4059695imm; Tue, 25 Sep 2018 10:37:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV61+2r5zW4qJ7Xcjxbm/Wc+qspusZuYZ91zmevgTh0kRP5hc1cWAcDCk4M4zSwPFQZ6dPXzW X-Received: by 2002:a17:902:7246:: with SMTP id c6-v6mr2235392pll.304.1537897049240; Tue, 25 Sep 2018 10:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537897049; cv=none; d=google.com; s=arc-20160816; b=xwVOJlGuqWEncNMLBUaOvpHwbBWpJnUpwsYch6pva1ZxCqXtmQy29I2KWYJC1YRmi5 E93oADUHakTigekmw4s2YtQ94szGSpjVXGK5C45TDa2xtdDOfCpHccUOtkJ/SAGCHhu6 ON/Y7jawz5TGMrggGGmQ2uPi7jdKN+xLgIVMMA+oRa04j8Q8MsnF+LJG1Hg+kHMvcsx/ kY8EBF6Lala2iM678pRBY8QYnvbnAj70SMjj0KG1pJR9GPsKfhkon/tgz37ZmBaSpdYw WxypAQRZIDpVzGK2FgfLoUk4pDMH/aNrgK/tigKPHHky7qp6MKPl8evquNViH++1beY7 G+Aw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=r82II8y7yMekjKHIzl/QuD2hhNlsz+dSEDG48FngPN4=; b=oVtXKFgrvLYxAUhPfHc0YRr1HUdtYHSfhNNUBTfsNccTN+TydK9n/7leENPI3YKkra wER/yUWdNwHUKtTkLddYWK95rHvwPYlvg915ajEh3r0TMJOvRzPip4RyKaIi7SCmnmz5 drWy99TKZsce1L5HgAIJ1u/bb+rvoKZ2sNpstFYi9vL1tZ/aptO+MvlPm3OmGYlfDKx0 owom3x2RniFhuxXLMcWT0Uk5yoYegmgXWvy4Xui9aBzhrEn0CR4BdRxvZ8OrY9R12tJF KFEUYS8wqiIBseHaUDLRu6zaC3jhTeeUXsv2OhrqcVb7haqatfK/aszK3gpxWcVz3p5F 5HVw== ARC-Authentication-Results: i=1; mx.google.com; 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 l12-v6si3019545pgj.76.2018.09.25.10.37.13; Tue, 25 Sep 2018 10:37:29 -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; 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 S1726474AbeIYXny (ORCPT + 99 others); Tue, 25 Sep 2018 19:43:54 -0400 Received: from tartarus.angband.pl ([54.37.238.230]:50414 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbeIYXnx (ORCPT ); Tue, 25 Sep 2018 19:43:53 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.89) (envelope-from ) id 1g4rEt-00051V-0g; Tue, 25 Sep 2018 19:35:11 +0200 Date: Tue, 25 Sep 2018 19:35:11 +0200 From: Adam Borowski To: "Theodore Y. Ts'o" , 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: <20180925173510.273hshp4iapd6dcd@angband.pl> References: <486f6105fd4076c1af67dae7fdfe6826019f7ff4.camel@redhat.com> <20180925003044.239531c7@alans-desktop> <0662a4c5d2e164d651a6a116d06da380f317100f.camel@redhat.com> <20180925154627.GC2933@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180925154627.GC2933@thunk.org> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); 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 11:46:27AM -0400, Theodore Y. Ts'o wrote: > P.S. One thought: it might be cool if there was some way for > userspace applications to mark files with "nuke if not closed" flag, > such that if the system crashes, the file systems would automatically > unlink the file after a reboot or if the process was killed or exits > without an explicit close(2). For networked/remote file systems that > supported this flag, after the client comes back up after a reboot, it > could notify the server that all files created previously from that > client should be unlinked. > > Unlike O_TMPFILE, this would require file system changes to support, > so maybe it's not worth having something which automatically cleans up > files that were in the middle of being written at the time of a system > crash. 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); Meow! -- ⢀⣴⠾⠻⢶⣦⠀ 10 people enter a bar: ⣾⠁⢰⠒⠀⣿⡁ • 1 who understands binary, ⢿⡄⠘⠷⠚⠋⠀ • 1 who doesn't, ⠈⠳⣄⠀⠀⠀⠀ • and E who prefer to write it as hex.