summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1997-04-16 19:52:34 +0000
committerThomas Bushnell <thomas@gnu.org>1997-04-16 19:52:34 +0000
commit2e77e9a4d22a5e29af1b9d8d4d24ed7e35b94325 (patch)
treecc58a903c1883f6270b8156405889d4061aa8b3c /libdiskfs
parent1c1dc4983882eaaf1fc41e129a985c86d4456235 (diff)
Mon Feb 24 14:40:02 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* dir-rmdir.c (diskfs_S_dir_rmdir): Check EBUSY-when-translated error before ENOTDIR-when-not-dir.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/ChangeLog8
-rw-r--r--libdiskfs/dir-rmdir.c24
2 files changed, 20 insertions, 12 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog
index 6a6781f4..1eebec53 100644
--- a/libdiskfs/ChangeLog
+++ b/libdiskfs/ChangeLog
@@ -4,6 +4,11 @@ Mon Feb 24 17:22:05 1997 Miles Bader <miles@gnu.ai.mit.edu>
inode number to fshelp_get_identity when creating a shadow root
fsid, not INUM.
+Mon Feb 24 14:40:02 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * dir-rmdir.c (diskfs_S_dir_rmdir): Check EBUSY-when-translated
+ error before ENOTDIR-when-not-dir.
+
Sat Feb 22 00:00:32 1997 Miles Bader <miles@gnu.ai.mit.edu>
* io-stat.c (diskfs_S_io_stat): Mark shadow roots with S_IROOT.
@@ -62,7 +67,8 @@ Wed Feb 12 14:23:15 1997 Miles Bader <miles@gnu.ai.mit.edu>
Get rid of depth parameters to diskfs_lookup.
Deal properly with EAGAIN return from diskfs_lookup.
Replace references to dotdotport with root_parent.
- * dir-unlink.c (diskfs_S_dir_unlink): Don't pass depth args to diskfs_lookup.
+ * dir-unlink.c (diskfs_S_dir_unlink): Don't pass depth args to
+ diskfs_lookup.
* dir-rmdir.c (diskfs_S_dir_rmdir): Likewise.
* dir-renamed.c (diskfs_rename_dir, checkpath): Likewise.
* dir-rename.c (diskfs_S_dir_rename): Likewise.
diff --git a/libdiskfs/dir-rmdir.c b/libdiskfs/dir-rmdir.c
index a5274d71..a6387023 100644
--- a/libdiskfs/dir-rmdir.c
+++ b/libdiskfs/dir-rmdir.c
@@ -41,10 +41,20 @@ diskfs_S_dir_rmdir (struct protid *dircred,
error = diskfs_lookup (dnp, name, REMOVE, &np, ds, dircred);
if (error == EAGAIN)
error = ENOTEMPTY;
- else if (np && !S_ISDIR (np->dn_stat.st_mode))
+
+ if (np)
{
- diskfs_nput (np);
- error = ENOTDIR;
+ if ((np->dn_stat.st_mode & S_IPTRANS)
+ || fshelp_translated (&np->transbox))
+ {
+ diskfs_nput (np);
+ error = EBUSY;
+ }
+ if (!S_ISDIR (np->dn_stat.st_mode))
+ {
+ diskfs_nput (np);
+ error = ENOTDIR;
+ }
}
if (error)
{
@@ -62,14 +72,6 @@ diskfs_S_dir_rmdir (struct protid *dircred,
return EINVAL;
}
- if ((np->dn_stat.st_mode & S_IPTRANS) || fshelp_translated (&np->transbox))
- {
- diskfs_drop_dirstat (dnp, ds);
- diskfs_nput (np);
- mutex_unlock (&dnp->lock);
- return EBUSY;
- }
-
/* Verify the directory is empty (and valid). (Rmdir ".." won't be
valid since ".." will contain a reference to the current directory and
thus be non-empty). */