7f4c2a
From 05926a815a7df19c732d1ab7ea2ef3b36632038f Mon Sep 17 00:00:00 2001
7f4c2a
From: Jiffin Tony Thottan <jthottan@redhat.com>
7f4c2a
Date: Mon, 7 Sep 2015 16:46:48 +0530
7f4c2a
Subject: [PATCH 322/330] uss : handle `buf` variable properly in svs_glfs_readdir()
7f4c2a
7f4c2a
The svs_glfs_readdir() is a generic function which is called from
7f4c2a
svs_readdir() and svs_readdirp(). But in svs_readdir 'buf' variable
7f4c2a
is passed as NULL, then glfs_read_readdir() will fail. This patch
7f4c2a
will fix the same.
7f4c2a
7f4c2a
It is backport of http://review.gluster.org/12117
7f4c2a
7f4c2a
Upstream Reference:
7f4c2a
> Change-Id: Id02e4e17e30c85de117db5ddd9f97b578622dff9
7f4c2a
> BUG: 1260611
7f4c2a
> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
7f4c2a
> cherry-picked as 7b6183c36ebfe020b724c95b018a8cd535e1ecdd
7f4c2a
7f4c2a
Change-Id: I22628fdf3267e9366a5aa0df2b7984c0e6318819
7f4c2a
BUG: 1260086
7f4c2a
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/57343
7f4c2a
Reviewed-by: Niels de Vos <ndevos@redhat.com>
7f4c2a
Tested-by: Niels de Vos <ndevos@redhat.com>
7f4c2a
---
7f4c2a
 .../features/snapview-server/src/snapview-server.c |    6 +++---
7f4c2a
 1 files changed, 3 insertions(+), 3 deletions(-)
7f4c2a
7f4c2a
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
7f4c2a
index 5ae9625..ed30cb8 100644
7f4c2a
--- a/xlators/features/snapview-server/src/snapview-server.c
7f4c2a
+++ b/xlators/features/snapview-server/src/snapview-server.c
7f4c2a
@@ -1246,7 +1246,6 @@ svs_glfs_readdir (xlator_t *this, glfs_fd_t *glfd, gf_dirent_t *entries,
7f4c2a
         GF_VALIDATE_OR_GOTO ("svs", this, out);
7f4c2a
         GF_VALIDATE_OR_GOTO (this->name, glfd, out);
7f4c2a
         GF_VALIDATE_OR_GOTO (this->name, entries, out);
7f4c2a
-        GF_VALIDATE_OR_GOTO (this->name, buf, out);
7f4c2a
 
7f4c2a
         while (filled_size < size) {
7f4c2a
                 in_case = glfs_telldir (glfd);
7f4c2a
@@ -1287,9 +1286,10 @@ svs_glfs_readdir (xlator_t *this, glfs_fd_t *glfd, gf_dirent_t *entries,
7f4c2a
                         entry->d_off = glfs_telldir (glfd);
7f4c2a
                         entry->d_ino = de.d_ino;
7f4c2a
                         entry->d_type = de.d_type;
7f4c2a
-                        iatt_from_stat (buf, &statbuf);
7f4c2a
-                        if (readdirplus)
7f4c2a
+                        if (readdirplus) {
7f4c2a
+                                iatt_from_stat (buf, &statbuf);
7f4c2a
                                 entry->d_stat = *buf;
7f4c2a
+                        }
7f4c2a
                         list_add_tail (&entry->list, &entries->list);
7f4c2a
 
7f4c2a
                         filled_size += this_size;
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a