summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-08-04 08:43:33 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-08-08 21:41:43 +0200
commite4d2b16a445f85b7dc3fc67b21756eca515e0c74 (patch)
treef56809a2002a559d3e1d07b4d4fd1c2038d35045 /fs
parent864364a29c26ed83b3eeca5fa278468dc3ae9ed4 (diff)
downloadlinux-0-day-e4d2b16a445f85b7dc3fc67b21756eca515e0c74.tar.gz
linux-0-day-e4d2b16a445f85b7dc3fc67b21756eca515e0c74.tar.xz
ceph: fix null pointer dereference in ceph_flush_snaps()
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/caps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 99115cae1652a..16e6ded0b7f28 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1347,9 +1347,12 @@ void ceph_flush_snaps(struct ceph_inode_info *ci,
{
struct inode *inode = &ci->vfs_inode;
struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
- struct ceph_mds_session *session = *psession;
+ struct ceph_mds_session *session = NULL;
int mds;
+
dout("ceph_flush_snaps %p\n", inode);
+ if (psession)
+ session = *psession;
retry:
spin_lock(&ci->i_ceph_lock);
if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) {