diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-08-03 20:43:33 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-08-08 15:41:43 -0400 |
commit | e4d2b16a445f85b7dc3fc67b21756eca515e0c74 (patch) | |
tree | f56809a2002a559d3e1d07b4d4fd1c2038d35045 | |
parent | 864364a29c26ed83b3eeca5fa278468dc3ae9ed4 (diff) |
ceph: fix null pointer dereference in ceph_flush_snaps()
Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r-- | fs/ceph/caps.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 99115cae1652..16e6ded0b7f2 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1347,9 +1347,12 @@ void ceph_flush_snaps(struct ceph_inode_info *ci, | |||
1347 | { | 1347 | { |
1348 | struct inode *inode = &ci->vfs_inode; | 1348 | struct inode *inode = &ci->vfs_inode; |
1349 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; | 1349 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; |
1350 | struct ceph_mds_session *session = *psession; | 1350 | struct ceph_mds_session *session = NULL; |
1351 | int mds; | 1351 | int mds; |
1352 | |||
1352 | dout("ceph_flush_snaps %p\n", inode); | 1353 | dout("ceph_flush_snaps %p\n", inode); |
1354 | if (psession) | ||
1355 | session = *psession; | ||
1353 | retry: | 1356 | retry: |
1354 | spin_lock(&ci->i_ceph_lock); | 1357 | spin_lock(&ci->i_ceph_lock); |
1355 | if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) { | 1358 | if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) { |