diff options
author | Xiubo Li <xiubli@redhat.com> | 2022-06-07 10:13:53 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-08-03 00:54:12 +0200 |
commit | 4849077604f0126514d487836e7d87c3e53a753c (patch) | |
tree | ca79b0bb252803a925477c6411f786876cfaee47 /fs/ceph/super.h | |
parent | 0006164589ecc755cd6bbc46e466e32be20fe285 (diff) | |
download | lwn-4849077604f0126514d487836e7d87c3e53a753c.tar.gz lwn-4849077604f0126514d487836e7d87c3e53a753c.zip |
ceph: don't get the inline data for new creating files
If the 'i_inline_version' is 1, that means the file is just new
created and there shouldn't have any inline data in it, we should
skip retrieving the inline data from MDS.
This also could help reduce possiblity of dead lock issue introduce
by the inline data and Fcr caps.
Gradually we will remove the inline feature from kclient after ceph's
scrub too have support to unline the inline data, currently this
could help reduce the teuthology test failures.
This is possiblly could also fix a bug that for some old clients if
they couldn't explictly uninline the inline data when writing, the
inline version will keep as 1 always. We may always reading non-exist
data from inline data.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 3b146c0fbb2b..40630e6f691c 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1231,6 +1231,14 @@ extern int ceph_pool_perm_check(struct inode *inode, int need); extern void ceph_pool_perm_destroy(struct ceph_mds_client* mdsc); int ceph_purge_inode_cap(struct inode *inode, struct ceph_cap *cap, bool *invalidate); +static inline bool ceph_has_inline_data(struct ceph_inode_info *ci) +{ + if (ci->i_inline_version == CEPH_INLINE_NONE || + ci->i_inline_version == 1) /* initial version, no data */ + return false; + return true; +} + /* file.c */ extern const struct file_operations ceph_file_fops; |