diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-06-09 21:09:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-26 15:08:58 +0300 |
commit | 8193ad306ea0005bbe1f2f8fc600ab270d27c8dd (patch) | |
tree | 33ba2f85c31acff8be36a5bf59a0bd5d2000a86d /fs/ceph/inode.c | |
parent | 41aa215734868ba7cb195e2cc5f00cdba5bd1578 (diff) | |
download | linux-8193ad306ea0005bbe1f2f8fc600ab270d27c8dd.tar.xz |
ceph: allow ceph_put_mds_session to take NULL or ERR_PTR
[ Upstream commit 7e65624d32b6e0429b1d3559e5585657f34f74a1 ]
...to simplify some error paths.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 57cd78e942c0..63e781e4f7e4 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1121,8 +1121,7 @@ static inline void update_dentry_lease(struct inode *dir, struct dentry *dentry, __update_dentry_lease(dir, dentry, lease, session, from_time, &old_lease_session); spin_unlock(&dentry->d_lock); - if (old_lease_session) - ceph_put_mds_session(old_lease_session); + ceph_put_mds_session(old_lease_session); } /* @@ -1167,8 +1166,7 @@ static void update_dentry_lease_careful(struct dentry *dentry, from_time, &old_lease_session); out_unlock: spin_unlock(&dentry->d_lock); - if (old_lease_session) - ceph_put_mds_session(old_lease_session); + ceph_put_mds_session(old_lease_session); } /* |