From owner-freebsd-current@freebsd.org Fri Dec 7 06:25:38 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 0EBAC132BBC6 for ; Fri, 7 Dec 2018 06:25:38 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 44BF5799F5; Fri, 7 Dec 2018 06:25:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x82b.google.com with SMTP id d18so3342446qto.8; Thu, 06 Dec 2018 22:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=R783LZ0IEdcGaVpXcpiIQ0k3BaNkyFKQoKloJZR0Qcg=; b=PUDSKG2hjnWPWwYZckhuLMf6ua7qPJ7acbKB59Muq9hS0wvpx9LjUsBvK2La4jub9V BUjqfO6f9X8jSPEHkAGiHQ9a+oX/Y9Kdn7GLl9AJ52n/MeJPo00TmVdxVfawWn6ZbgVh SWYQ/y/hfBCL+dDMvWmzJZ9zYV5gQrr/oFHHdwDyXjgnn2PFXLYSV8NLqX2T1BRyedx8 OmqtzLxYc/3inrTCUA32s3A9bV+C+Fn3uyFCompitdCW80zNzww6SGKdrVcUuk2oD0XH 8si6IAiR/Hxr+MrQFweAx9ULOum2NsrqEJ9N81zpJbD1LYHkdV9NvAFrwpNQDLJ3R2CT EL1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=R783LZ0IEdcGaVpXcpiIQ0k3BaNkyFKQoKloJZR0Qcg=; b=JJgWGIU0oNezBo08YMSb4WrEuZF8UBjyo5bnmeaIvlTXl8gkp2yjajNsR+8OhCB7qX bPLe3U+w/VlUyiTiAySNaY5HkWeiBn8YuPKsj5Q3hIU7XW0PtmlvqZxLZrXf+YU6xoku J7zEX5muCI+rboE9As4PqC3f4VebgxZophoLC3S8glhky0bxT6zSOThHOuQNboWgd/zy MowXOTOKiTjGG0L/Zj7va1w7zsdG79+WnyxEqTjkn9jEftVdCPAFem17vYyDS8cCG32f oml+eLgDAu+zcp9WJmmvNM+Xr7rK3pBsTSIl62T0eoK56Q4Ay3dJrPkAHDGtkI0rbfn8 /W/Q== X-Gm-Message-State: AA+aEWb236+W5VFAR/P0+H7Ag8pALbveekXqVyc643/zgVRvPrAHUB87 MJQ6QwlCaHX6E782+zf/IJcZpZOavFN5/wwehls= X-Google-Smtp-Source: AFSGD/XHiJ7FXEBse+1mQEMXib3MEsrrwZyKgDjT3EicL18sQj4exFSrT8jakPqHxAUDoTLo6L/aybtFmZeXKnVVa7Q= X-Received: by 2002:ac8:4258:: with SMTP id r24mr848551qtm.213.1544163936889; Thu, 06 Dec 2018 22:25:36 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Thu, 6 Dec 2018 22:25:36 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Fri, 7 Dec 2018 07:25:36 +0100 Message-ID: Subject: Re: rm cannot recursively delete directory on tmpfs on RPi2 To: Jia-Shiun Li Cc: Alan Somers , freebsd-current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 44BF5799F5 X-Spamd-Result: default: False [-5.82 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[b.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; 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:2607:f8b0::/32, country:US]; IP_SCORE(-1.82)[ip: (-6.16), ipnet: 2607:f8b0::/32(-1.53), asn: 15169(-1.31), country: US(-0.09)] 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 06:25:38 -0000 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: diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a1b98c5660c..b250c54033c 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -523,7 +523,7 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -#if defined(__mips__) || defined(__powerpc__) +#ifndef __LP64__ #define UNR64_LOCKED #endif -- Mateusz Guzik