diff options
-rw-r--r-- | libdiskfs/ChangeLog | 10 | ||||
-rw-r--r-- | libdiskfs/dir-rmdir.c | 3 | ||||
-rw-r--r-- | libdiskfs/lookup.c | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index d10ea2ef..81118fe2 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,6 +1,14 @@ +1999-06-29 Thomas Bushnell, BSG <tb@mit.edu> + + * lookup.c (diskfs_lookup): If we get an error from + fshelp_checkdirmod, clear *NP as well as returning the error. + Use diskfs_nrele instead of diskfs_nput in case *NP and DP are + the same. + 1999-06-28 Thomas Bushnell, BSG <tb@mit.edu> - * dir-rmdir.c (diskfs_S_dir_rmdir): Reorganized to make clearer. + * dir-rmdir.c (diskfs_S_dir_rmdir): Reorganized to make clearer; + several little buglets fixed too. 1999-06-27 Thomas Bushnell, BSG <tb@mit.edu> diff --git a/libdiskfs/dir-rmdir.c b/libdiskfs/dir-rmdir.c index 314e4e0a..637c00f4 100644 --- a/libdiskfs/dir-rmdir.c +++ b/libdiskfs/dir-rmdir.c @@ -42,6 +42,9 @@ diskfs_S_dir_rmdir (struct protid *dircred, if (error == EAGAIN) error = ENOTEMPTY; + if (error) + goto out; + /* Attempt to rmdir(".") */ if (dnp == np) { diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c index 2dd75a92..3ec9dd87 100644 --- a/libdiskfs/lookup.c +++ b/libdiskfs/lookup.c @@ -183,7 +183,13 @@ diskfs_lookup (struct node *dp, const char *name, enum lookup_type type, if (err2) { if (np && !err) - diskfs_nput (*np); + { + if (*np == dp) + diskfs_nrele (*np); + else + diskfs_nput (*np); + *np = 0; + } return err2; } } |