Received: by 10.192.165.148 with SMTP id m20csp4861188imm; Tue, 1 May 2018 05:18:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5wXs1BEyhfUg55dgUULIObqP82N29YoJYSRD0CRCFotuC4TYsWW5VJgoFO3KPNo3QmbpI X-Received: by 2002:a17:902:7795:: with SMTP id o21-v6mr15835887pll.8.1525177082196; Tue, 01 May 2018 05:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525177082; cv=none; d=google.com; s=arc-20160816; b=PEHZO5OgtVDKYFCID7a0+pAmG/9IFwfx66IR1dWX0mWEPjxLDfRYjg1Yy2FprZyuzz RL1bZ4CfJPBwoaCooflYXutxb6PTir30FXL4e2ufjQDOYPC79CwpagYQjaNGthju7PK9 o5ThJSC4IcN/GQY/IeJ0nFixILhD8lRN2GcxgXGL1Tx/5P+c+V4FNKlVPD145p/LQJrM BMdMepNcS+KG7HtUc4ZA9PoOGmy03xXsAcfIaTIAoJkGRbGyBHw0LvnjgfS27cxbYOkq GF7nDD8ElsC19/bawsvpHMHwTNQXJCidc9xcDhK3Ery9ioy7wxm408SpEjGwHJVXt49U fC+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=9uMlVM1Lg2Fx+FdjnWssB+cC3N9nkKsKIaWkqgLW/QQ=; b=eYdfQKUTz/XTXR3tmYS66bb/M8jZSRodt6m58fz5cHWrdkMIVrIpsorBczms+3J1r6 ja6n00C7wO5QDrf+OOx15mlO9lhUEPn0WBwfcQ1Xi9LxTrknBqTnkbn9xSSwvYv1kB6I vXop+bm3pIFvjXyqm9mragHGc2MxTgo5PuWEFN6wu/4vwCnZUpTLg7BTNid4CcqSFMFv OsEwDuqSrl8/c9xEuVyaLCmc9AAPFElMtL+CPdrG2bJB/pMVXZHA7H2iJiUsLKIA+r7R g9NX4whV3XIFkiQWnzCBkj7L3d140nhNUhtU8Kwb7YHLgAKfwIwDFlgGoqYngTkGLBrx kqMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tony-gen-nz.20150623.gappssmtp.com header.s=20150623 header.b=mLpmy/Ok; 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 t9-v6si7863178pgq.301.2018.05.01.05.17.48; Tue, 01 May 2018 05:18:02 -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=pass header.i=@tony-gen-nz.20150623.gappssmtp.com header.s=20150623 header.b=mLpmy/Ok; 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 S1755685AbeEAMR1 (ORCPT + 99 others); Tue, 1 May 2018 08:17:27 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34944 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755215AbeEAMRX (ORCPT ); Tue, 1 May 2018 08:17:23 -0400 Received: by mail-pf0-f193.google.com with SMTP id j5so9018047pfh.2 for ; Tue, 01 May 2018 05:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tony-gen-nz.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=9uMlVM1Lg2Fx+FdjnWssB+cC3N9nkKsKIaWkqgLW/QQ=; b=mLpmy/OkqoaHljnMCBQcO9sYUxkqxt4FiRrxdbtCgEmeRHUSHSkwtaMZQnUKHimR+l VToYAbf9jVeKNe4HahlPEYPfFYqxMVFEDFRBE6ZT8bWorPmATGCBx3/DMIdatrX2YcaD aMwI5YAiqhnOmg6sbVg846EYFAMGCgeQ4VU/KdqCxvCncIB2pKOZVQZcKL0E04kbE4R9 cMVZEkFlY3LchgM6TSBBfYqXOzJFQjiEPKIvjchraX21R+VeSRVcoHbbS84etk123IbO TEH4Xba5Z1zHOhnLR2qBlJ0gJ9TeWfoXH/MV45l6X/nUccU8jwynhoX8tFk9ADOcJCrw oZEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=9uMlVM1Lg2Fx+FdjnWssB+cC3N9nkKsKIaWkqgLW/QQ=; b=daAl+lX2U0Pd3k3YRQDzy7A2r+7drhmJaHqo7972lCQFOj0MkoHm324L+wBXhZR5yc GBT5tgex1q+98CAiCzAoXKpFRc+0fY5HJaNee4cYEYsre17HaTkDT4q/5sGUO+VEhVeh 3cJSB2TWK0QDp130FUd1Sw69o+JBFczFfAiZnePyWOR30CXkUAWfWbJzFNIx3XRQmhCO SBL1TbaV/MspO6BMx8Ws1qXba3RmlQmLBramgUkUuqZzvfBoqZDYy7x2QeiCYw1Ynk9Q 7j2h0aFLHr1PwGns3HFyCkMyKfI9b3875gkjXBBWIh5lKjLcjqbKycQe0m5+WEkqrC43 uUUA== X-Gm-Message-State: ALQs6tDIpI5F8Of5X18GAcwUkJ7vEAbtDr3QTQ+bld+kaDAu+J4g0oAC P/1bGrxw+Hs4buv9R+Yp0bY7pTV/rls= X-Received: by 2002:a17:902:7291:: with SMTP id d17-v6mr16028988pll.218.1525177042569; Tue, 01 May 2018 05:17:22 -0700 (PDT) Received: from [192.168.42.74] ([118.149.162.43]) by smtp.gmail.com with ESMTPSA id r5-v6sm8428797pgp.81.2018.05.01.05.17.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 05:17:21 -0700 (PDT) Subject: Re: Suggested new user link command To: Richard Weinberger Cc: Bernd Petrovitsch , LKML References: <1525165387.23227.44.camel@petrovitsch.priv.at> From: Tony Wallace Openpgp: preference=signencrypt Autocrypt: addr=tony@tony.gen.nz; prefer-encrypt=mutual; keydata= xsBNBFJQ2EUBCADNvUoh5QwEOCnkYCEMwg8zJzp8chmFePT2wqVmWAQXVPPKOWsHyGxYmoDe Guqpvmhx4rPpjW9CpX1xN7m6JPGE7FDCpw6WiOjAuNycSUFbKrVaSGpzMHjVx3eJpwOtEGTz DbHmGz32to1D2SwuITmXpVzXLAR4+A9ywSozaZc42UeLf/9jh77SR3mKEJpMxiqD6Ui+XGTV 3zJRPTdh0s8z4lAhgqRM+he8bRpURydaTgGaEUDKDSHL/3bBx+q0QTcnWpGJRDjyqhlO87eu EXtZZbgBwg5+N+OGhZ5pzs82g6tKyHTLUsHsO2fPjXz1SFoxBlhQQRpHg25F4YgfNEOFABEB AAHNKEFudGhvbnkgSmFtZXMgV2FsbGFjZSA8dG9ueUB0b255Lmdlbi5uej7CwHgEEwECACIF AlJQ2EUCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEDrpo/TJux46690H/AvCKeQ3 pSWRWptbEsbWT9xPfmk9eD8LsYIIV/mHu/QhpekHeiSYv59lP3pLcOv7BYhe4oe4rte5Xc5z mllQBTFhFtIqNpv8UDWWmPGmS58nXm9fQaEJGoJ6XVYX9OWcD6B70x1U1DJFj8YJpaoUZLcJ rfbyUfqYVNjmRq3x8prdXZohTki9lHrcqMpyz30MYjV4cCGz/rj9cQpBDlfPIxG10zbyPSvD gclJJ9hGW9FHq3h8oH4kJR4jHUa0o2xy9ZdLQnAl196kB3yonHgFPexb4HPvwRxL23qtSxkY B7p7IJTf0xbk9UOPWD7EhY0ASiFgSw7uv/VwYceVe3PXkCvOwE0EUlDYRQEIAMNv3KI6lMO9 Z3UyPwrEwzBWCqKkcVJwCh3UUgHQKSxeYdL8PhFnaQD0kr0J0R1sLKooS+OExu5rmvy3qoQ3 BA2f13OUZF2ZotW3woVSGStSniEzs6l7L+mWtBQwyIjSyMPa4tuxKIWgy1b2S1axk0yTgn9w 45ycTLiuT0H9FoNAZahRpU9gvH2gwJkZFoaW+5iibpzceFxUX7bfutdcw2FhV0dh1lkvGcdO QnaoWZcislZ5hFFfy07SDtGBqu46C0hRZKwZ1lj/H4/uJwQXmD6ywEusJDnqjFqellYJHmoP 9s7q3POwWvxr5pXquLb/GlWvmEWFSwyozuypqRsLhzEAEQEAAcLAXwQYAQIACQUCUlDYRQIb DAAKCRA66aP0ybseOoHNCACZ/mwhUt3jxzDAroX+3YosiQRh8cFFHOk6RUpt4eLjrk12DVHY CuNIHf16jyMQybkOeBvyeWxvNpXzapdjMWK7Zp0eVQEAeKj9J/PQzZFHpYy0z0L2OQjKR2q8 ciXRMm8ytF/mJZZbYICyyL5Yq4gz8Gs+mXROUmYDvadt9NxMLJH4kynF11FEnIPTq0xBuBuf Q/GAAlKxvc4anYWduDuvHUKcTnRssj6TW5ThxFyoBpuF/h0qDyfcUrE5y+WUcGjYyHu9j6oW UBsT9zlpxkqRNxO38tAnl601FBLtJClYygBz9Ro6DQAIcQX1Wqvcv3jLszOzH2hiu1Yg2Ipz 0Sdc Message-ID: <388f79ad-4ed0-ec39-f649-5c120ee9dc2f@tony.gen.nz> Date: Wed, 2 May 2018 00:17:13 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-AU Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two issues here: 1) Use case (which I have) 2) Permissions 1) Use case I am trying to build a backup system.=C2=A0 To avoid duplication of files= over multiple backups I take an Md5 check sum of file contents.=C2=A0 Fil= es with the same sum are hardlinked together.=C2=A0=C2=A0 Files are linked i= n to a standard directory structure a new link for each backup that the file is part of.=C2=A0 When all backups pointing to a file are deleted the refere= nce count drops to zero and the file is deleted.=C2=A0 We can keep a database= of checksums and there related inode numbers for linking purposes.=C2=A0 So = why not have some reference copy to link against it would take no extra space.=C2=A0 Well it doesn't, but it keeps at least one copy of the file = on disk forever and the reference count never drops to zero.=C2=A0 Using one= of the backup copies to link to (as stored as the reference copy in the database) will not work as it could be deleted at any time. I have seen on stack overflow others wanting to do this also. 2) Permissions To maintain security there are two requirements:=C2=A0 2.1) The effective user must have rights to the inode, that is they must either own it or be root 2.2) The effective user must have rights file creation rights to the directory where it is being linked If you say no, that is fine, but I do think this idea has merit and can be done without compromising the system. I am off to bed, it is the middle of the night here in New Zealand. Tony On 01/05/18 23:04, Richard Weinberger wrote: > On Tue, May 1, 2018 at 12:58 PM, Tony Wallace wrote:= >> Good point. But there are gid and uid fields in inode disc record. >> >> https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table >> >> I assume these can be use to ensure that the directory in which it is = to >> be placed has permissions to accept the inode. If that is not the cas= e >> then it would have to be a root only syscall. > Before we dig into details, please come up with a very good use case. := -) > But I'm with Bernd, I don't think it is worth the permissions hassle. >