From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francis Moreau Subject: Can't rmdir an empty directory when using overlayfs Date: Thu, 28 Aug 2014 16:22:11 +0200 Message-ID: <53FF3B13.3060103@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Miklos Szeredi , Andy Whitcroft To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-we0-f178.google.com ([74.125.82.178]:39425 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbaH1OTv (ORCPT ); Thu, 28 Aug 2014 10:19:51 -0400 Received: by mail-we0-f178.google.com with SMTP id u57so852531wes.37 for ; Thu, 28 Aug 2014 07:19:50 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, I've a weird problem when using overlayfs. The version I'm using is quite old, it's v12 on top of a 3.4 kernel. I guess the patches are coming from: http://git.kernel.org/cgit/linux/kernel/git/apw/overlayfs.git/log/?h=overlayfs.v12apw1 Sorry if the version is old but I'm stick with 3.4 and v12 seems the latest version available for this kernel. My problem is that I can't rmdir an empty directory, it fails with 'device or resource busy'. This directory is created by an application and is used to mount a block device. Once the job is finished the block device is unmounted and finally app tries to rmdir it. The directory doesn't seem to be a mountpoint (anymore). Looking in /proc/mounts confirm this. I tried to trace what's going on in the kernel when calling the syscall 'rmdir' and found that it's currently failing in vfs_rmdir() when testing for that particular condition: error = -EBUSY; if (d_mountpoint(dentry)) goto out; If I'm not mistaken, the kernel still thinks that the directory is a mountpoint. Another weird behaviour is that if I'm touching/modifying some unrelated files (not in the directory) before starting my app, then the issue disappear. Does this issue seem to be an old known issue ? Thanks !