cluster/dht: Check for size 0 in check_is_linkfile()

Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 574 (Sticky bit files are not listed in the output of ls on a dht volume)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=574
This commit is contained in:
Vijay Bellur 2010-01-28 08:24:23 +00:00 committed by Anand V. Avati
parent 15b3f715ac
commit 4462b4a31e

View File

@ -161,7 +161,9 @@ typedef struct dht_disk_layout dht_disk_layout_t;
#define is_last_call(cnt) (cnt == 0)
#define DHT_LINKFILE_MODE (S_ISVTX)
#define check_is_linkfile(i,s,x) ((s->st_mode & ~S_IFMT) == DHT_LINKFILE_MODE)
#define check_is_linkfile(i,s,x) ( \
((s->st_mode & ~S_IFMT) == DHT_LINKFILE_MODE) && \
(s->st_size == 0))
#define check_is_dir(i,s,x) (S_ISDIR(s->st_mode))