diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-06-14 23:54:47 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-16 22:01:08 -0700 |
commit | acbf2d5dd4782c4236373237d73980163936d17c (patch) | |
tree | 6d908edbc89ba99c40671a336760cd825149282a /xlators/features | |
parent | c4c0f7cd9b951bf0f201fa6a52eaebfd4b86c45b (diff) |
features/marker: fixes in dirty inode self-heal codepath.
- fix fd-leak of fd opened on the directory.
- don't add (instead just assign) next offset at which readdir has to be sent
to local->d_off.
- assign to local->d_off before winding lookup call to get child contribution.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2697 (Quota: add-brick creates the size go awkward, though it was perfect earlier)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2697
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/marker/src/marker-quota.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 355ea1d10fe..fdcd22bc79d 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -426,6 +426,8 @@ quota_readdir_cbk (call_frame_t *frame, entry->d_name); continue; } + + offset = entry->d_off; count++; } @@ -435,6 +437,7 @@ quota_readdir_cbk (call_frame_t *frame, LOCK (&local->lock); { local->dentry_child_count = count; + local->d_off = offset; } UNLOCK (&local->lock); } @@ -447,7 +450,6 @@ quota_readdir_cbk (call_frame_t *frame, ".."))) { gf_log (this->name, GF_LOG_DEBUG, "entry = %s", entry->d_name); - offset = entry->d_off; continue; } @@ -513,17 +515,12 @@ quota_readdir_cbk (call_frame_t *frame, break; } } - gf_log (this->name, GF_LOG_DEBUG, "offset before =%"PRIu64, - local->d_off); - local->d_off +=offset; - gf_log (this->name, GF_LOG_DEBUG, "offset after = %"PRIu64, - local->d_off); - if (ret) + if (ret) { release_lock_on_dirty_inode (frame, NULL, this, 0, 0); - - else if (count == 0 ) + } else if (count == 0 ) { get_dirty_inode_size (frame, this); + } return 0; } @@ -619,6 +616,10 @@ err: release_lock_on_dirty_inode (frame, NULL, this, 0, 0); } + if (fd != NULL) { + fd_unref (fd); + } + return 0; } |