diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-05-01 10:03:40 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-06-25 11:49:28 +0300 |
commit | 7b06a826e7c52d77ce801e5960ecf0338eafe886 (patch) | |
tree | cb4f7bc04116a3a4d673152096bc994131304574 /fs/ceph/addr.c | |
parent | b01da6a08c523f5d1cd1a51107f8cca061040f45 (diff) | |
download | linux-7b06a826e7c52d77ce801e5960ecf0338eafe886.tar.bz2 |
ceph: use empty snap context for uninline_data and get_pool_perm
Cached_context in ceph_snap_realm is directly accessed by
uninline_data() and get_pool_perm(). This is racy in theory.
both uninline_data() and get_pool_perm() do not modify existing
object, they only create new object. So we can pass the empty
snap context to them. Unlike cached_context in ceph_snap_realm,
we do not need to protect the empty snap context.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r-- | fs/ceph/addr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b96027727248..ccc4325aa5c5 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1510,8 +1510,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) ceph_vino(inode), 0, &len, 0, 1, CEPH_OSD_OP_CREATE, CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE, - ci->i_snap_realm->cached_context, - 0, 0, false); + ceph_empty_snapc, 0, 0, false); if (IS_ERR(req)) { err = PTR_ERR(req); goto out; @@ -1529,7 +1528,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) ceph_vino(inode), 0, &len, 1, 3, CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE, - ci->i_snap_realm->cached_context, + ceph_empty_snapc, ci->i_truncate_seq, ci->i_truncate_size, false); if (IS_ERR(req)) { @@ -1653,7 +1652,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, u32 pool) } rd_req = ceph_osdc_alloc_request(&fsc->client->osdc, - ci->i_snap_realm->cached_context, + ceph_empty_snapc, 1, false, GFP_NOFS); if (!rd_req) { err = -ENOMEM; @@ -1668,7 +1667,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, u32 pool) rd_req->r_base_oid.name_len = strlen(rd_req->r_base_oid.name); wr_req = ceph_osdc_alloc_request(&fsc->client->osdc, - ci->i_snap_realm->cached_context, + ceph_empty_snapc, 1, false, GFP_NOFS); if (!wr_req) { err = -ENOMEM; |