From owner-freebsd-current@freebsd.org Fri Dec 7 11:12:19 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A521334E87 for ; Fri, 7 Dec 2018 11:12:19 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4771E85E2C for ; Fri, 7 Dec 2018 11:12:18 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr1-x42c.google.com with SMTP id c14so3456881wrr.0 for ; Fri, 07 Dec 2018 03:12:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:cc:references:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J2msJBprtIFHhbjvHNoOHomW1zaEb+hNOFQWN6ErA/w=; b=jZMb8WdBsqtsDddvwnjQ4roW+pAVQcbRtMMyedH6NeePPxVmvuB/H7Z8K6IhW6JGSM HfTYWllnJ0HYHWdTly1WKugbhJqG4u196gEXzzcAk5guApapisGT6SPcDhOQ7OozddtY iJa6p6sO67qJGAiEJkeQvNiM+iKvo0TVwCw/p+nM8H83vOjUiHypFFgxEYS6eX5wLo9M /ynGPBH5obzSbczYdxGYNeC/pxfzrTf6xv0kyLWocHABGmSSYDv0BipAOEV7kPA7W6tq 7d/ncVqZaIf3SvyIftm4EnLBEqSAtU6/3q4ZpUPPaXeVkWJzO0JKekkWC/26Iz/U2Mdu MihQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:cc:references:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=J2msJBprtIFHhbjvHNoOHomW1zaEb+hNOFQWN6ErA/w=; b=Rwn/C6uaHqx0SEl6p+pHlGY4WBY6amnsR8XYgfJrhDLJo5Ch/FZjy2wB7TzAcrDRgp mk0VcL30R43JdWeVY+wiEeZlDjm5vgA1Q/LnJwn3AwqfeIAwC5M3407Lz9kmg6vApOb8 TWXfKvR/30pdnUjlRmOcD8pVy5vHHJM098Z1zKPku2V8qV1PIR6BI63l7gfvEyoKzdxM 1RSFMoG/S4yIRT0GWe5Yz+/KeT2z6Fiv1vsO2paQck3/gTNBtaxWAPwuYat7T8D9N6Bl X6ag3X4TCzHbPoI5uUX3Jalv/W7srG83W4pp157vcV6qSDFfocC1gzJ0I31u/gsXhbQ8 CrCQ== X-Gm-Message-State: AA+aEWZpqEFqVNwKkuozyJ3sdT+NjpumBQkejhIGKvdiMsWFtxOsMFWI CjuKTA5QBF/w0T6pUsU5apn3HDio X-Google-Smtp-Source: AFSGD/Wj1E3Ji8UXBAUQD/m1t1B/SD8lQ8Y37HhNaJDULUjzg5zE/CyVBqv4a/3TkXMGhx4oBhYmzQ== X-Received: by 2002:a05:6000:1c8:: with SMTP id t8mr1487115wrx.146.1544181136960; Fri, 07 Dec 2018 03:12:16 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id k128sm1666643wmd.37.2018.12.07.03.12.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:12:16 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: rm cannot recursively delete directory on tmpfs on RPi2 To: Mateusz Guzik Cc: freebsd-current@freebsd.org References: <16c12239-031e-14fd-e82a-450b242338c5@freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=mmel@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFYuVRkBCADZiwLCCne3wG9b9k+R2Neo5zVo2bLaZRfNNY/v9kg283i0sb1Da4EdEiNT 15El5UyozhphUIbIR/zrVpxF1TvvFdoCyzx6a68bNY2d9dBrDcNDZC+XnyDdHQoobN87DWT1 mRVkmbg9LHZ/SVUOkGYuWyE+8UYeDAcUizuXwSK5zFWmeTyIoWNa68ifrWLfQe0p4x5jC/AI VURCi17p360vU4fhgwoMvEEhrRBWCr4DYHToFjIt2WdBy3GR1qoO0+Xkd6G+OoBULo+XDfgu L2WdPvh0K69F9/LgHkMmG5Il7SCe62QGpG2vaCgRV7BQhLX+kxlvM+WrdRatWRml4Y/3ABEB AAHNIE1pY2hhbCBNZWxvdW4gPG1tZWxAZnJlZWJzZC5vcmc+wsCABBMBCgAqAhsDBQsJCAcD BRUKCQgLBRYDAgEAAh4BAheAAhkBBQJZjBHDBQkHICOqAAoJEGkesmtexaqqIKMIAJ9xTp1w ge86ns2ZYOac5++mAgpFatohSlxYUR3gwud3Y3Ej0eumavpv/C26N6dsLnspwRenKdLbIPKe 0N8lI7CcDBIJGiFyY3c4H79QjIkYpRgbWFyCM85zEyVJpB+U7BhsgXE2uwVjE9RNhEP0KBoj sp357uqq1B1+VUO4GJ+RjdmYSOcNrjR8tTfy02456qovGjJ4JcJBlhyK6GzBKvnZSoA0s+QP OMn3gd8gdomMLEJdS3kTsfhLh2rQPZa9EmzafIyjXrirWq4+4fVFgd8SiMZyyTM+Kz30ZSUe 6SmfaQTQ/WLRIl5jku2uYQWlrRIKT9xaQzRWtZO9UgtXFRHOwE0EVi5VGQEIALqgRkfS21D/ OqWE9mXfh2bIjrp9uC8T0MCuimbsrAdLKNNorGu2nE+rebgX8n5nYM377HOnalPGyOuXvCbQ 8MFVRdWOHxenJjXJialNdBsOf2wLva3vSSVsdoPzibWDIcJqhBOQ3EuhsILyWSPvYYKEiy95 mfhrDtuTTOAYVR9aNQBOENztB2TDJyMx/qZmtGroGV3N0Hqde/znHPtQO8RG5/FQGMfHMI5G FMuycr1ceHnLo/ovrqAl4TYV+UHSHJ+FDE9dt9wXHclWbWbC0yNugchZq6rho5Jjfv4a2v7P pyn3HoDinh1lWP7hYA0ZNExGHekLnXWVqO/lzGS6bMEAEQEAAcLAZQQYAQoADwIbDAUCWYwR wwUJByAjqgAKCRBpHrJrXsWqqrsrB/4g4ESK5TLxUxi8pLWcLPyvwtN4Fmf7VsCVefkhakaG rDPmfvfnG+OFwN60Xqoni7GBeakl01xwT4RINfvVfShDy6cHpLS7QL/M8pzfulVX38MkVkOD yGZhwjE+jyT/kZNA1Olaw3N3IefHq3brskQ7G4d9oPep2DDbw7C4Q76uOBjxy34JVB0WOsB6 NyMQB9h6LGljQtdEddyUqwnRZzzHiGvp0hPtdYQHQZlqbj4FV9lTRK7a8Ega+y7MgmeMiztG zeXyjNP02r3PRHCPagwa57bPxH2aAh4Q7UzBBZ0GTMm7DLKNtCP58WDxblrrhZ+7kHqGK8Fs bdeUpDdEYLVd Message-ID: <9283b100-2908-aed0-08a7-6289a03cb0fc@freebsd.org> Date: Fri, 7 Dec 2018 12:12:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4771E85E2C X-Spamd-Result: default: False [-6.38 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-2.37)[ip: (-8.95), ipnet: 2a00:1450::/32(-1.52), asn: 15169(-1.30), country: US(-0.09)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[c.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2018 11:12:19 -0000 On 07.12.2018 10:59, Mateusz Guzik wrote: > On 12/7/18, Michal Meloun wrote: >> >> >> On 07.12.2018 7:25, Mateusz Guzik wrote: >>> On 12/7/18, Jia-Shiun Li wrote: >>>> On Fri, Dec 7, 2018 at 12:36 AM Alan Somers wrote: >>>> >>>>> On Wed, Dec 5, 2018 at 10:18 PM Jia-Shiun Li >>>>> wrote: >>>>>> >>>>>> amd64 and RPi3 do not have this issue. >>>>>> >>>>>> jsli@rpi2:/home/jsli 13:04 # uname -a >>>>>> FreeBSD rpi2 13.0-CURRENT FreeBSD 13.0-CURRENT r341419 GENERIC-NODEBUG >>>>> arm >>>>>> jsli@rpi2:/home/jsli 13:05 # mount -t tmpfs tmpfs /mnt >>>>>> jsli@rpi2:/home/jsli 13:05 # cd /mnt >>>>>> jsli@rpi2:/mnt 13:05 # tar xf >>>>>> /usr/ports/distfiles/sqlite-autoconf-3260000.tar.gz >>>>>> jsli@rpi2:/mnt 13:05 # rm -rf sqlite-autoconf-3260000/ >>>>>> rm: sqlite-autoconf-3260000/tea: Operation not permitted >>>>>> rm: sqlite-autoconf-3260000/: Directory not empty >>>>>> jsli@rpi2:/mnt 13:05 # >>>>>> >>>>>> -Jia-Shiun >>>>> >>>>> Did you check for file flags? Do "ls -lod >>>>> sqlite-autoconf-3260000/tea". >>>>> >>>>> >>>> Unlikely caused by flags I think. >>>> >>>> jsli@rpi2:/home/jsli # mount -t tmpfs tmpfs /mnt >>>> jsli@rpi2:/home/jsli # cd /mnt >>>> jsli@rpi2:/mnt # ls -R >>>> jsli@rpi2:/mnt # mkdir dir >>>> jsli@rpi2:/mnt # ls -R >>>> dir/ >>>> ls: dir: directory causes a cycle >>>> jsli@rpi2:/mnt # >>>> >>>> >>>> looks inode no for directories are wrong >>>> >>>> jsli@rpi2:/mnt # ll -ia >>>> total 4 >>>> 2 drwxr-xr-x 3 root wheel 36 Dec 7 09:55 ./ >>>> 2 drwxr-xr-x 23 root wheel 512 Dec 3 17:04 ../ >>>> 2 drwxr-xr-x 2 root wheel 0 Dec 7 09:55 dir/ >>>> jsli@rpi2:/mnt # ll -ia dir >>>> total 0 >>>> 2 drwxr-xr-x 2 root wheel 0 Dec 7 09:55 ./ >>>> 2 drwxr-xr-x 3 root wheel 36 Dec 7 09:55 ../ >>>> jsli@rpi2:/mnt # >>>> >>> >>> Ouch. >>> >>> Looks like 64-bit atomic on 32-bit arm don't work as advertised. >>> >>> While they should be fixed, I have been meaning to commit the following >>> which will have a side effect of taking care of the bug you ran into: >>> >> >> Mateusz, >> where you see problem with 64-bit atomic on arm? I'm not aware of any >> problem in this area. > > inode allocation for tmpfs (and other places) was recently changed to use > 64-bit atomics (excluding mips and powerpc). So far atomic_fetchadd_64 > failing to bump the number on 32-bit arm (at least for the variant used > by whatever is put on rpi2) looks like a decent explanation. The code > definitely works on amd64. > Fixed in r341679. Thanks for report.