diff options
author | Raghavendra G <raghavendra@gluster.com> | 2012-04-16 11:38:33 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-18 00:00:16 -0700 |
commit | 7ef32ae76d1c1e4a5ff47899d175be9fdeb73bc8 (patch) | |
tree | 7cc913672ddcf5ee073dde5af1a0ab16a267ba85 /xlators/performance/quick-read | |
parent | 80eeaab2be884f0ebc89704011421541742cd5e6 (diff) |
performance/quick-read: disable reading from cache if unlink has
happened after fd was opened.
If dentry being unlinked is the last one, there is a possibility that
later, a new entry with same name being created. After creation of new
file, we shouldn't be returning the contents of this new file, when
application reads using fd opened before unlink.
Change-Id: Ic98aa9cd76d24e8a37ce02a0aae6c66290043192
BUG: 811976
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3151
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/performance/quick-read')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 6476ec5f5a8..beddfd878a8 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -3245,6 +3245,10 @@ qr_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, LOCK (&fdctx->lock); { + if (qr_inode->stbuf.ia_nlink == 1) { + fdctx->disabled = 1; + } + if ((fdctx->opened) || (strcmp (loc->path, fdctx->path) != 0)) { list_del (&fdctx->tmp_list); |