linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ENOTEMPTY on "rm -rf" for snapshot and subvolume
@ 2010-04-08  0:44 Harshavardhana
  2010-04-08 13:52 ` Chris Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Harshavardhana @ 2010-04-08  0:44 UTC (permalink / raw)
  To: linux-btrfs

Hi Everyone,

      Recently i created a snapshot of an existing volume which had some 
amount of data.
      Now that after creating the snapshot i have tried deleting the 
same snapshot.  But i am
      getting ENOTEMPTY for "rmdir". But when i see the actual files 
inside are deleted
      not the parent directory.

      From the code it looks like

      if (inode->i_size > BTRFS_EMPTY_DIR_SIZE ||
             inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
                 return -ENOTEMPTY;

      Why would "unlink" succeeds for the files inside the directory?, 
yet returning ENOTEMPTY

      This looks odd after this, i  went ahead and tried deleting the 
the existing volume itself
      same result.

      So i was wondering if at all this is supposed to work this way, do 
i need to use "btrfs"
      commands to delete subvolumes always? and their relative snapshots?.

      But either in that case too returning ENOTEMPTY does confuse a 
user a lot. Isn't it valid
      just by returning EPERM will explain a lot to users saying that 
this is a snapshot of a
      subvolume or a parent subvolume which is not supposed to be 
deleted this way.

Regards

-- 
Harshavardhana
http://www.gluster.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-08 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08  0:44 ENOTEMPTY on "rm -rf" for snapshot and subvolume Harshavardhana
2010-04-08 13:52 ` Chris Mason
2010-04-08 21:14   ` Harshavardhana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).