From 9dbae0c80569689533c92a29871e3fa6dbbae1b9 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 22 Feb 2010 08:59:10 +0000 Subject: dht: unlink stale linkfiles in rmdir to prevent ENOTEMPTY Thanks to He Xaobing , this patch is inspired by http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=188#c2 Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 188 ([ glusterfs 2.0.6rc2 ] - "Directory not empty" on rm -rf) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=188 --- xlators/cluster/dht/src/dht-common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.h') diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 53aeaa0f7a6..42a75adfbde 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -70,7 +70,7 @@ struct dht_local { struct stat stbuf; struct stat prebuf; struct stat preoldparent; - struct stat postoldparent; + struct stat postoldparent; struct stat preparent; struct stat postparent; struct statvfs statvfs; @@ -89,6 +89,7 @@ struct dht_local { char need_selfheal; int file_count; int dir_count; + call_frame_t *main_frame; struct { fop_mknod_cbk_t linkfile_cbk; struct stat stbuf; @@ -154,7 +155,7 @@ struct dht_disk_layout { } list[1]; }; typedef struct dht_disk_layout dht_disk_layout_t; - + #define ENTRY_MISSING(op_ret, op_errno) (op_ret == -1 && op_errno == ENOENT) #define is_fs_root(loc) (strcmp (loc->path, "/") == 0) @@ -269,4 +270,6 @@ void dht_layout_unref (xlator_t *this, dht_layout_t *layout); dht_layout_t *dht_layout_ref (xlator_t *this, dht_layout_t *layout); xlator_t *dht_first_up_subvol (xlator_t *this); +int dht_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name); + #endif /* _DHT_H */ -- cgit