mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'ceph-for-6.7-rc1' of https://github.com/ceph/ceph-client
Pull ceph updates from Ilya Dryomov:
- support for idmapped mounts in CephFS (Christian Brauner, Alexander
Mikhalitsyn).
The series was originally developed by Christian and later picked up
and brought over the finish line by Alexander, who also contributed
an enabler on the MDS side (separate owner_{u,g}id fields on the
wire).
The required exports for mnt_idmap_{get,put}() in VFS have been acked
by Christian and received no objection from Christoph.
- a churny change in CephFS logging to include cluster and client
identifiers in log and debug messages (Xiubo Li).
This would help in scenarios with dozens of CephFS mounts on the same
node which are getting increasingly common, especially in the
Kubernetes world.
* tag 'ceph-for-6.7-rc1' of https://github.com/ceph/ceph-client:
ceph: allow idmapped mounts
ceph: allow idmapped atomic_open inode op
ceph: allow idmapped set_acl inode op
ceph: allow idmapped setattr inode op
ceph: pass idmap to __ceph_setattr
ceph: allow idmapped permission inode op
ceph: allow idmapped getattr inode op
ceph: pass an idmapping to mknod/symlink/mkdir
ceph: add enable_unsafe_idmap module parameter
ceph: handle idmapped mounts in create_request_message()
ceph: stash idmapping in mdsc request
fs: export mnt_idmap_get/mnt_idmap_put
libceph, ceph: move mdsmap.h to fs/ceph
ceph: print cluster fsid and client global_id in all debug logs
ceph: rename _to_client() to _to_fs_client()
ceph: pass the mdsc to several helpers
libceph: add doutc and *_client debug macros support
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "super.h"
|
||||
#include "mds_client.h"
|
||||
|
||||
static inline void ceph_set_cached_acl(struct inode *inode,
|
||||
int type, struct posix_acl *acl)
|
||||
@@ -31,6 +32,7 @@ static inline void ceph_set_cached_acl(struct inode *inode,
|
||||
|
||||
struct posix_acl *ceph_get_acl(struct inode *inode, int type, bool rcu)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int size;
|
||||
unsigned int retry_cnt = 0;
|
||||
const char *name;
|
||||
@@ -72,8 +74,8 @@ retry:
|
||||
} else if (size == -ENODATA || size == 0) {
|
||||
acl = NULL;
|
||||
} else {
|
||||
pr_err_ratelimited("get acl %llx.%llx failed, err=%d\n",
|
||||
ceph_vinop(inode), size);
|
||||
pr_err_ratelimited_client(cl, "%llx.%llx failed, err=%d\n",
|
||||
ceph_vinop(inode), size);
|
||||
acl = ERR_PTR(-EIO);
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
case ACL_TYPE_ACCESS:
|
||||
name = XATTR_NAME_POSIX_ACL_ACCESS;
|
||||
if (acl) {
|
||||
ret = posix_acl_update_mode(&nop_mnt_idmap, inode,
|
||||
ret = posix_acl_update_mode(idmap, inode,
|
||||
&new_mode, &acl);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -140,7 +142,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
newattrs.ia_ctime = current_time(inode);
|
||||
newattrs.ia_mode = new_mode;
|
||||
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
|
||||
ret = __ceph_setattr(inode, &newattrs, NULL);
|
||||
ret = __ceph_setattr(idmap, inode, &newattrs, NULL);
|
||||
if (ret)
|
||||
goto out_free;
|
||||
}
|
||||
@@ -151,7 +153,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
newattrs.ia_ctime = old_ctime;
|
||||
newattrs.ia_mode = old_mode;
|
||||
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
|
||||
__ceph_setattr(inode, &newattrs, NULL);
|
||||
__ceph_setattr(idmap, inode, &newattrs, NULL);
|
||||
}
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
299
fs/ceph/addr.c
299
fs/ceph/addr.c
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
void ceph_fscache_register_inode_cookie(struct inode *inode)
|
||||
{
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
|
||||
|
||||
/* No caching for filesystem? */
|
||||
if (!fsc->fscache)
|
||||
|
||||
761
fs/ceph/caps.c
761
fs/ceph/caps.c
File diff suppressed because it is too large
Load Diff
@@ -113,7 +113,7 @@ static int ceph_crypt_set_context(struct inode *inode, const void *ctx,
|
||||
|
||||
cia.fscrypt_auth = cfa;
|
||||
|
||||
ret = __ceph_setattr(inode, &attr, &cia);
|
||||
ret = __ceph_setattr(&nop_mnt_idmap, inode, &attr, &cia);
|
||||
if (ret == 0)
|
||||
inode_set_flags(inode, S_ENCRYPTED, S_ENCRYPTED);
|
||||
kfree(cia.fscrypt_auth);
|
||||
@@ -129,7 +129,7 @@ static bool ceph_crypt_empty_dir(struct inode *inode)
|
||||
|
||||
static const union fscrypt_policy *ceph_get_dummy_policy(struct super_block *sb)
|
||||
{
|
||||
return ceph_sb_to_client(sb)->fsc_dummy_enc_policy.policy;
|
||||
return ceph_sb_to_fs_client(sb)->fsc_dummy_enc_policy.policy;
|
||||
}
|
||||
|
||||
static struct fscrypt_operations ceph_fscrypt_ops = {
|
||||
@@ -212,6 +212,7 @@ void ceph_fscrypt_as_ctx_to_req(struct ceph_mds_request *req,
|
||||
static struct inode *parse_longname(const struct inode *parent,
|
||||
const char *name, int *name_len)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(parent);
|
||||
struct inode *dir = NULL;
|
||||
struct ceph_vino vino = { .snap = CEPH_NOSNAP };
|
||||
char *inode_number;
|
||||
@@ -223,12 +224,12 @@ static struct inode *parse_longname(const struct inode *parent,
|
||||
name++;
|
||||
name_end = strrchr(name, '_');
|
||||
if (!name_end) {
|
||||
dout("Failed to parse long snapshot name: %s\n", name);
|
||||
doutc(cl, "failed to parse long snapshot name: %s\n", name);
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
*name_len = (name_end - name);
|
||||
if (*name_len <= 0) {
|
||||
pr_err("Failed to parse long snapshot name\n");
|
||||
pr_err_client(cl, "failed to parse long snapshot name\n");
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@ static struct inode *parse_longname(const struct inode *parent,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
ret = kstrtou64(inode_number, 10, &vino.ino);
|
||||
if (ret) {
|
||||
dout("Failed to parse inode number: %s\n", name);
|
||||
doutc(cl, "failed to parse inode number: %s\n", name);
|
||||
dir = ERR_PTR(ret);
|
||||
goto out;
|
||||
}
|
||||
@@ -251,7 +252,7 @@ static struct inode *parse_longname(const struct inode *parent,
|
||||
/* This can happen if we're not mounting cephfs on the root */
|
||||
dir = ceph_get_inode(parent->i_sb, vino, NULL);
|
||||
if (IS_ERR(dir))
|
||||
dout("Can't find inode %s (%s)\n", inode_number, name);
|
||||
doutc(cl, "can't find inode %s (%s)\n", inode_number, name);
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -262,6 +263,7 @@ out:
|
||||
int ceph_encode_encrypted_dname(struct inode *parent, struct qstr *d_name,
|
||||
char *buf)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(parent);
|
||||
struct inode *dir = parent;
|
||||
struct qstr iname;
|
||||
u32 len;
|
||||
@@ -330,7 +332,7 @@ int ceph_encode_encrypted_dname(struct inode *parent, struct qstr *d_name,
|
||||
|
||||
/* base64 encode the encrypted name */
|
||||
elen = ceph_base64_encode(cryptbuf, len, buf);
|
||||
dout("base64-encoded ciphertext name = %.*s\n", elen, buf);
|
||||
doutc(cl, "base64-encoded ciphertext name = %.*s\n", elen, buf);
|
||||
|
||||
/* To understand the 240 limit, see CEPH_NOHASH_NAME_MAX comments */
|
||||
WARN_ON(elen > 240);
|
||||
@@ -505,7 +507,10 @@ int ceph_fscrypt_decrypt_block_inplace(const struct inode *inode,
|
||||
struct page *page, unsigned int len,
|
||||
unsigned int offs, u64 lblk_num)
|
||||
{
|
||||
dout("%s: len %u offs %u blk %llu\n", __func__, len, offs, lblk_num);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
|
||||
doutc(cl, "%p %llx.%llx len %u offs %u blk %llu\n", inode,
|
||||
ceph_vinop(inode), len, offs, lblk_num);
|
||||
return fscrypt_decrypt_block_inplace(inode, page, len, offs, lblk_num);
|
||||
}
|
||||
|
||||
@@ -514,7 +519,10 @@ int ceph_fscrypt_encrypt_block_inplace(const struct inode *inode,
|
||||
unsigned int offs, u64 lblk_num,
|
||||
gfp_t gfp_flags)
|
||||
{
|
||||
dout("%s: len %u offs %u blk %llu\n", __func__, len, offs, lblk_num);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
|
||||
doutc(cl, "%p %llx.%llx len %u offs %u blk %llu\n", inode,
|
||||
ceph_vinop(inode), len, offs, lblk_num);
|
||||
return fscrypt_encrypt_block_inplace(inode, page, len, offs, lblk_num,
|
||||
gfp_flags);
|
||||
}
|
||||
@@ -583,6 +591,7 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
|
||||
u64 off, struct ceph_sparse_extent *map,
|
||||
u32 ext_cnt)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int i, ret = 0;
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
u64 objno, objoff;
|
||||
@@ -590,7 +599,8 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
|
||||
|
||||
/* Nothing to do for empty array */
|
||||
if (ext_cnt == 0) {
|
||||
dout("%s: empty array, ret 0\n", __func__);
|
||||
doutc(cl, "%p %llx.%llx empty array, ret 0\n", inode,
|
||||
ceph_vinop(inode));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -604,14 +614,17 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
|
||||
int fret;
|
||||
|
||||
if ((ext->off | ext->len) & ~CEPH_FSCRYPT_BLOCK_MASK) {
|
||||
pr_warn("%s: bad encrypted sparse extent idx %d off %llx len %llx\n",
|
||||
__func__, i, ext->off, ext->len);
|
||||
pr_warn_client(cl,
|
||||
"%p %llx.%llx bad encrypted sparse extent "
|
||||
"idx %d off %llx len %llx\n",
|
||||
inode, ceph_vinop(inode), i, ext->off,
|
||||
ext->len);
|
||||
return -EIO;
|
||||
}
|
||||
fret = ceph_fscrypt_decrypt_pages(inode, &page[pgidx],
|
||||
off + pgsoff, ext->len);
|
||||
dout("%s: [%d] 0x%llx~0x%llx fret %d\n", __func__, i,
|
||||
ext->off, ext->len, fret);
|
||||
doutc(cl, "%p %llx.%llx [%d] 0x%llx~0x%llx fret %d\n", inode,
|
||||
ceph_vinop(inode), i, ext->off, ext->len, fret);
|
||||
if (fret < 0) {
|
||||
if (ret == 0)
|
||||
ret = fret;
|
||||
@@ -619,7 +632,7 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
|
||||
}
|
||||
ret = pgsoff + fret;
|
||||
}
|
||||
dout("%s: ret %d\n", __func__, ret);
|
||||
doutc(cl, "ret %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ static int mdsc_show(struct seq_file *s, void *p)
|
||||
if (req->r_inode) {
|
||||
seq_printf(s, " #%llx", ceph_ino(req->r_inode));
|
||||
} else if (req->r_dentry) {
|
||||
path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
|
||||
path = ceph_mdsc_build_path(mdsc, req->r_dentry, &pathlen,
|
||||
&pathbase, 0);
|
||||
if (IS_ERR(path))
|
||||
path = NULL;
|
||||
@@ -100,7 +100,7 @@ static int mdsc_show(struct seq_file *s, void *p)
|
||||
}
|
||||
|
||||
if (req->r_old_dentry) {
|
||||
path = ceph_mdsc_build_path(req->r_old_dentry, &pathlen,
|
||||
path = ceph_mdsc_build_path(mdsc, req->r_old_dentry, &pathlen,
|
||||
&pathbase, 0);
|
||||
if (IS_ERR(path))
|
||||
path = NULL;
|
||||
@@ -398,7 +398,7 @@ DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
|
||||
|
||||
void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
|
||||
{
|
||||
dout("ceph_fs_debugfs_cleanup\n");
|
||||
doutc(fsc->client, "begin\n");
|
||||
debugfs_remove(fsc->debugfs_bdi);
|
||||
debugfs_remove(fsc->debugfs_congestion_kb);
|
||||
debugfs_remove(fsc->debugfs_mdsmap);
|
||||
@@ -407,13 +407,14 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
|
||||
debugfs_remove(fsc->debugfs_status);
|
||||
debugfs_remove(fsc->debugfs_mdsc);
|
||||
debugfs_remove_recursive(fsc->debugfs_metrics_dir);
|
||||
doutc(fsc->client, "done\n");
|
||||
}
|
||||
|
||||
void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
|
||||
{
|
||||
char name[100];
|
||||
|
||||
dout("ceph_fs_debugfs_init\n");
|
||||
doutc(fsc->client, "begin\n");
|
||||
fsc->debugfs_congestion_kb =
|
||||
debugfs_create_file("writeback_congestion_kb",
|
||||
0600,
|
||||
@@ -469,6 +470,7 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
|
||||
&metrics_size_fops);
|
||||
debugfs_create_file("caps", 0400, fsc->debugfs_metrics_dir, fsc,
|
||||
&metrics_caps_fops);
|
||||
doutc(fsc->client, "done\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
242
fs/ceph/dir.c
242
fs/ceph/dir.c
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,7 @@ struct ceph_nfs_snapfh {
|
||||
static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
|
||||
struct inode *parent_inode)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
static const int snap_handle_length =
|
||||
sizeof(struct ceph_nfs_snapfh) >> 2;
|
||||
struct ceph_nfs_snapfh *sfh = (void *)rawfh;
|
||||
@@ -79,13 +80,14 @@ static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
|
||||
*max_len = snap_handle_length;
|
||||
ret = FILEID_BTRFS_WITH_PARENT;
|
||||
out:
|
||||
dout("encode_snapfh %llx.%llx ret=%d\n", ceph_vinop(inode), ret);
|
||||
doutc(cl, "%p %llx.%llx ret=%d\n", inode, ceph_vinop(inode), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
|
||||
struct inode *parent_inode)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
static const int handle_length =
|
||||
sizeof(struct ceph_nfs_fh) >> 2;
|
||||
static const int connected_handle_length =
|
||||
@@ -105,15 +107,15 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
|
||||
|
||||
if (parent_inode) {
|
||||
struct ceph_nfs_confh *cfh = (void *)rawfh;
|
||||
dout("encode_fh %llx with parent %llx\n",
|
||||
ceph_ino(inode), ceph_ino(parent_inode));
|
||||
doutc(cl, "%p %llx.%llx with parent %p %llx.%llx\n", inode,
|
||||
ceph_vinop(inode), parent_inode, ceph_vinop(parent_inode));
|
||||
cfh->ino = ceph_ino(inode);
|
||||
cfh->parent_ino = ceph_ino(parent_inode);
|
||||
*max_len = connected_handle_length;
|
||||
type = FILEID_INO32_GEN_PARENT;
|
||||
} else {
|
||||
struct ceph_nfs_fh *fh = (void *)rawfh;
|
||||
dout("encode_fh %llx\n", ceph_ino(inode));
|
||||
doutc(cl, "%p %llx.%llx\n", inode, ceph_vinop(inode));
|
||||
fh->ino = ceph_ino(inode);
|
||||
*max_len = handle_length;
|
||||
type = FILEID_INO32_GEN;
|
||||
@@ -123,7 +125,7 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
|
||||
|
||||
static struct inode *__lookup_inode(struct super_block *sb, u64 ino)
|
||||
{
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc;
|
||||
struct inode *inode;
|
||||
struct ceph_vino vino;
|
||||
int err;
|
||||
@@ -205,7 +207,8 @@ static struct dentry *__snapfh_to_dentry(struct super_block *sb,
|
||||
struct ceph_nfs_snapfh *sfh,
|
||||
bool want_parent)
|
||||
{
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc;
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_mds_request *req;
|
||||
struct inode *inode;
|
||||
struct ceph_vino vino;
|
||||
@@ -278,11 +281,10 @@ static struct dentry *__snapfh_to_dentry(struct super_block *sb,
|
||||
ceph_mdsc_put_request(req);
|
||||
|
||||
if (want_parent) {
|
||||
dout("snapfh_to_parent %llx.%llx\n err=%d\n",
|
||||
vino.ino, vino.snap, err);
|
||||
doutc(cl, "%llx.%llx\n err=%d\n", vino.ino, vino.snap, err);
|
||||
} else {
|
||||
dout("snapfh_to_dentry %llx.%llx parent %llx hash %x err=%d",
|
||||
vino.ino, vino.snap, sfh->parent_ino, sfh->hash, err);
|
||||
doutc(cl, "%llx.%llx parent %llx hash %x err=%d", vino.ino,
|
||||
vino.snap, sfh->parent_ino, sfh->hash, err);
|
||||
}
|
||||
if (IS_ERR(inode))
|
||||
return ERR_CAST(inode);
|
||||
@@ -297,6 +299,7 @@ static struct dentry *ceph_fh_to_dentry(struct super_block *sb,
|
||||
struct fid *fid,
|
||||
int fh_len, int fh_type)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
struct ceph_nfs_fh *fh = (void *)fid->raw;
|
||||
|
||||
if (fh_type == FILEID_BTRFS_WITH_PARENT) {
|
||||
@@ -310,14 +313,14 @@ static struct dentry *ceph_fh_to_dentry(struct super_block *sb,
|
||||
if (fh_len < sizeof(*fh) / 4)
|
||||
return NULL;
|
||||
|
||||
dout("fh_to_dentry %llx\n", fh->ino);
|
||||
doutc(fsc->client, "%llx\n", fh->ino);
|
||||
return __fh_to_dentry(sb, fh->ino);
|
||||
}
|
||||
|
||||
static struct dentry *__get_parent(struct super_block *sb,
|
||||
struct dentry *child, u64 ino)
|
||||
{
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc;
|
||||
struct ceph_mds_request *req;
|
||||
struct inode *inode;
|
||||
int mask;
|
||||
@@ -363,6 +366,7 @@ static struct dentry *__get_parent(struct super_block *sb,
|
||||
static struct dentry *ceph_get_parent(struct dentry *child)
|
||||
{
|
||||
struct inode *inode = d_inode(child);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
struct dentry *dn;
|
||||
|
||||
if (ceph_snap(inode) != CEPH_NOSNAP) {
|
||||
@@ -402,8 +406,8 @@ static struct dentry *ceph_get_parent(struct dentry *child)
|
||||
dn = __get_parent(child->d_sb, child, 0);
|
||||
}
|
||||
out:
|
||||
dout("get_parent %p ino %llx.%llx err=%ld\n",
|
||||
child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
|
||||
doutc(cl, "child %p %p %llx.%llx err=%ld\n", child, inode,
|
||||
ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
|
||||
return dn;
|
||||
}
|
||||
|
||||
@@ -414,6 +418,7 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb,
|
||||
struct fid *fid,
|
||||
int fh_len, int fh_type)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
struct ceph_nfs_confh *cfh = (void *)fid->raw;
|
||||
struct dentry *dentry;
|
||||
|
||||
@@ -427,7 +432,7 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb,
|
||||
if (fh_len < sizeof(*cfh) / 4)
|
||||
return NULL;
|
||||
|
||||
dout("fh_to_parent %llx\n", cfh->parent_ino);
|
||||
doutc(fsc->client, "%llx\n", cfh->parent_ino);
|
||||
dentry = __get_parent(sb, NULL, cfh->ino);
|
||||
if (unlikely(dentry == ERR_PTR(-ENOENT)))
|
||||
dentry = __fh_to_dentry(sb, cfh->parent_ino);
|
||||
@@ -439,7 +444,7 @@ static int __get_snap_name(struct dentry *parent, char *name,
|
||||
{
|
||||
struct inode *inode = d_inode(child);
|
||||
struct inode *dir = d_inode(parent);
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
|
||||
struct ceph_mds_request *req = NULL;
|
||||
char *last_name = NULL;
|
||||
unsigned next_offset = 2;
|
||||
@@ -526,8 +531,8 @@ out:
|
||||
if (req)
|
||||
ceph_mdsc_put_request(req);
|
||||
kfree(last_name);
|
||||
dout("get_snap_name %p ino %llx.%llx err=%d\n",
|
||||
child, ceph_vinop(inode), err);
|
||||
doutc(fsc->client, "child dentry %p %p %llx.%llx err=%d\n", child,
|
||||
inode, ceph_vinop(inode), err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -544,7 +549,7 @@ static int ceph_get_name(struct dentry *parent, char *name,
|
||||
if (ceph_snap(inode) != CEPH_NOSNAP)
|
||||
return __get_snap_name(parent, name, child);
|
||||
|
||||
mdsc = ceph_inode_to_client(inode)->mdsc;
|
||||
mdsc = ceph_inode_to_fs_client(inode)->mdsc;
|
||||
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPNAME,
|
||||
USE_ANY_MDS);
|
||||
if (IS_ERR(req))
|
||||
@@ -588,9 +593,9 @@ static int ceph_get_name(struct dentry *parent, char *name,
|
||||
ceph_fname_free_buffer(dir, &oname);
|
||||
}
|
||||
out:
|
||||
dout("get_name %p ino %llx.%llx err %d %s%s\n",
|
||||
child, ceph_vinop(inode), err,
|
||||
err ? "" : "name ", err ? "" : name);
|
||||
doutc(mdsc->fsc->client, "child dentry %p %p %llx.%llx err %d %s%s\n",
|
||||
child, inode, ceph_vinop(inode), err, err ? "" : "name ",
|
||||
err ? "" : name);
|
||||
ceph_mdsc_put_request(req);
|
||||
return err;
|
||||
}
|
||||
|
||||
282
fs/ceph/file.c
282
fs/ceph/file.c
File diff suppressed because it is too large
Load Diff
511
fs/ceph/inode.c
511
fs/ceph/inode.c
File diff suppressed because it is too large
Load Diff
@@ -65,7 +65,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
|
||||
static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc;
|
||||
struct ceph_mds_request *req;
|
||||
struct ceph_ioctl_layout l;
|
||||
struct ceph_inode_info *ci = ceph_inode(file_inode(file));
|
||||
@@ -140,7 +140,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
|
||||
struct ceph_mds_request *req;
|
||||
struct ceph_ioctl_layout l;
|
||||
int err;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc;
|
||||
|
||||
/* copy and validate */
|
||||
if (copy_from_user(&l, arg, sizeof(l)))
|
||||
@@ -183,7 +183,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
struct ceph_osd_client *osdc =
|
||||
&ceph_sb_to_client(inode->i_sb)->client->osdc;
|
||||
&ceph_sb_to_fs_client(inode->i_sb)->client->osdc;
|
||||
struct ceph_object_locator oloc;
|
||||
CEPH_DEFINE_OID_ONSTACK(oid);
|
||||
u32 xlen;
|
||||
@@ -244,7 +244,8 @@ static long ceph_ioctl_lazyio(struct file *file)
|
||||
struct ceph_file_info *fi = file->private_data;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
|
||||
struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc;
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
|
||||
if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {
|
||||
spin_lock(&ci->i_ceph_lock);
|
||||
@@ -252,11 +253,13 @@ static long ceph_ioctl_lazyio(struct file *file)
|
||||
ci->i_nr_by_mode[ffs(CEPH_FILE_MODE_LAZY)]++;
|
||||
__ceph_touch_fmode(ci, mdsc, fi->fmode);
|
||||
spin_unlock(&ci->i_ceph_lock);
|
||||
dout("ioctl_layzio: file %p marked lazy\n", file);
|
||||
doutc(cl, "file %p %p %llx.%llx marked lazy\n", file, inode,
|
||||
ceph_vinop(inode));
|
||||
|
||||
ceph_check_caps(ci, 0);
|
||||
} else {
|
||||
dout("ioctl_layzio: file %p already lazy\n", file);
|
||||
doutc(cl, "file %p %p %llx.%llx already lazy\n", file, inode,
|
||||
ceph_vinop(inode));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -355,10 +358,12 @@ static const char *ceph_ioctl_cmd_name(const unsigned int cmd)
|
||||
|
||||
long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
|
||||
int ret;
|
||||
|
||||
dout("ioctl file %p cmd %s arg %lu\n", file,
|
||||
ceph_ioctl_cmd_name(cmd), arg);
|
||||
doutc(fsc->client, "file %p %p %llx.%llx cmd %s arg %lu\n", file,
|
||||
inode, ceph_vinop(inode), ceph_ioctl_cmd_name(cmd), arg);
|
||||
switch (cmd) {
|
||||
case CEPH_IOC_GET_LAYOUT:
|
||||
return ceph_ioctl_get_layout(file, (void __user *)arg);
|
||||
|
||||
@@ -77,6 +77,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
|
||||
int cmd, u8 wait, struct file_lock *fl)
|
||||
{
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_mds_request *req;
|
||||
int err;
|
||||
u64 length = 0;
|
||||
@@ -111,10 +112,10 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
|
||||
|
||||
owner = secure_addr(fl->fl_owner);
|
||||
|
||||
dout("ceph_lock_message: rule: %d, op: %d, owner: %llx, pid: %llu, "
|
||||
"start: %llu, length: %llu, wait: %d, type: %d\n", (int)lock_type,
|
||||
(int)operation, owner, (u64)fl->fl_pid, fl->fl_start, length,
|
||||
wait, fl->fl_type);
|
||||
doutc(cl, "rule: %d, op: %d, owner: %llx, pid: %llu, "
|
||||
"start: %llu, length: %llu, wait: %d, type: %d\n",
|
||||
(int)lock_type, (int)operation, owner, (u64)fl->fl_pid,
|
||||
fl->fl_start, length, wait, fl->fl_type);
|
||||
|
||||
req->r_args.filelock_change.rule = lock_type;
|
||||
req->r_args.filelock_change.type = cmd;
|
||||
@@ -147,16 +148,17 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
|
||||
|
||||
}
|
||||
ceph_mdsc_put_request(req);
|
||||
dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, "
|
||||
"length: %llu, wait: %d, type: %d, err code %d\n", (int)lock_type,
|
||||
(int)operation, (u64)fl->fl_pid, fl->fl_start,
|
||||
length, wait, fl->fl_type, err);
|
||||
doutc(cl, "rule: %d, op: %d, pid: %llu, start: %llu, "
|
||||
"length: %llu, wait: %d, type: %d, err code %d\n",
|
||||
(int)lock_type, (int)operation, (u64)fl->fl_pid,
|
||||
fl->fl_start, length, wait, fl->fl_type, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc,
|
||||
struct ceph_mds_request *req)
|
||||
{
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_mds_request *intr_req;
|
||||
struct inode *inode = req->r_inode;
|
||||
int err, lock_type;
|
||||
@@ -174,8 +176,7 @@ static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc,
|
||||
if (!err)
|
||||
return 0;
|
||||
|
||||
dout("ceph_lock_wait_for_completion: request %llu was interrupted\n",
|
||||
req->r_tid);
|
||||
doutc(cl, "request %llu was interrupted\n", req->r_tid);
|
||||
|
||||
mutex_lock(&mdsc->mutex);
|
||||
if (test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) {
|
||||
@@ -246,6 +247,7 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int err = 0;
|
||||
u16 op = CEPH_MDS_OP_SETFILELOCK;
|
||||
u8 wait = 0;
|
||||
@@ -257,7 +259,7 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
|
||||
if (ceph_inode_is_shutdown(inode))
|
||||
return -ESTALE;
|
||||
|
||||
dout("ceph_lock, fl_owner: %p\n", fl->fl_owner);
|
||||
doutc(cl, "fl_owner: %p\n", fl->fl_owner);
|
||||
|
||||
/* set wait bit as appropriate, then make command as Ceph expects it*/
|
||||
if (IS_GETLK(cmd))
|
||||
@@ -292,7 +294,7 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
|
||||
err = ceph_lock_message(CEPH_LOCK_FCNTL, op, inode, lock_cmd, wait, fl);
|
||||
if (!err) {
|
||||
if (op == CEPH_MDS_OP_SETFILELOCK && F_UNLCK != fl->fl_type) {
|
||||
dout("mds locked, locking locally\n");
|
||||
doutc(cl, "locking locally\n");
|
||||
err = posix_lock_file(file, fl, NULL);
|
||||
if (err) {
|
||||
/* undo! This should only happen if
|
||||
@@ -300,8 +302,8 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
|
||||
* deadlock. */
|
||||
ceph_lock_message(CEPH_LOCK_FCNTL, op, inode,
|
||||
CEPH_LOCK_UNLOCK, 0, fl);
|
||||
dout("got %d on posix_lock_file, undid lock\n",
|
||||
err);
|
||||
doutc(cl, "got %d on posix_lock_file, undid lock\n",
|
||||
err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -312,6 +314,7 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int err = 0;
|
||||
u8 wait = 0;
|
||||
u8 lock_cmd;
|
||||
@@ -322,7 +325,7 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
|
||||
if (ceph_inode_is_shutdown(inode))
|
||||
return -ESTALE;
|
||||
|
||||
dout("ceph_flock, fl_file: %p\n", fl->fl_file);
|
||||
doutc(cl, "fl_file: %p\n", fl->fl_file);
|
||||
|
||||
spin_lock(&ci->i_ceph_lock);
|
||||
if (ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) {
|
||||
@@ -359,7 +362,8 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
|
||||
ceph_lock_message(CEPH_LOCK_FLOCK,
|
||||
CEPH_MDS_OP_SETFILELOCK,
|
||||
inode, CEPH_LOCK_UNLOCK, 0, fl);
|
||||
dout("got %d on locks_lock_file_wait, undid lock\n", err);
|
||||
doutc(cl, "got %d on locks_lock_file_wait, undid lock\n",
|
||||
err);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
@@ -371,6 +375,7 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
|
||||
*/
|
||||
void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
struct file_lock *lock;
|
||||
struct file_lock_context *ctx;
|
||||
|
||||
@@ -386,17 +391,20 @@ void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
|
||||
++(*flock_count);
|
||||
spin_unlock(&ctx->flc_lock);
|
||||
}
|
||||
dout("counted %d flock locks and %d fcntl locks\n",
|
||||
*flock_count, *fcntl_count);
|
||||
doutc(cl, "counted %d flock locks and %d fcntl locks\n",
|
||||
*flock_count, *fcntl_count);
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a pointer to a lock, convert it to a ceph filelock
|
||||
*/
|
||||
static int lock_to_ceph_filelock(struct file_lock *lock,
|
||||
static int lock_to_ceph_filelock(struct inode *inode,
|
||||
struct file_lock *lock,
|
||||
struct ceph_filelock *cephlock)
|
||||
{
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int err = 0;
|
||||
|
||||
cephlock->start = cpu_to_le64(lock->fl_start);
|
||||
cephlock->length = cpu_to_le64(lock->fl_end - lock->fl_start + 1);
|
||||
cephlock->client = cpu_to_le64(0);
|
||||
@@ -414,7 +422,7 @@ static int lock_to_ceph_filelock(struct file_lock *lock,
|
||||
cephlock->type = CEPH_LOCK_UNLOCK;
|
||||
break;
|
||||
default:
|
||||
dout("Have unknown lock type %d\n", lock->fl_type);
|
||||
doutc(cl, "Have unknown lock type %d\n", lock->fl_type);
|
||||
err = -EINVAL;
|
||||
}
|
||||
|
||||
@@ -432,13 +440,14 @@ int ceph_encode_locks_to_buffer(struct inode *inode,
|
||||
{
|
||||
struct file_lock *lock;
|
||||
struct file_lock_context *ctx = locks_inode_context(inode);
|
||||
struct ceph_client *cl = ceph_inode_to_client(inode);
|
||||
int err = 0;
|
||||
int seen_fcntl = 0;
|
||||
int seen_flock = 0;
|
||||
int l = 0;
|
||||
|
||||
dout("encoding %d flock and %d fcntl locks\n", num_flock_locks,
|
||||
num_fcntl_locks);
|
||||
doutc(cl, "encoding %d flock and %d fcntl locks\n", num_flock_locks,
|
||||
num_fcntl_locks);
|
||||
|
||||
if (!ctx)
|
||||
return 0;
|
||||
@@ -450,7 +459,7 @@ int ceph_encode_locks_to_buffer(struct inode *inode,
|
||||
err = -ENOSPC;
|
||||
goto fail;
|
||||
}
|
||||
err = lock_to_ceph_filelock(lock, &flocks[l]);
|
||||
err = lock_to_ceph_filelock(inode, lock, &flocks[l]);
|
||||
if (err)
|
||||
goto fail;
|
||||
++l;
|
||||
@@ -461,7 +470,7 @@ int ceph_encode_locks_to_buffer(struct inode *inode,
|
||||
err = -ENOSPC;
|
||||
goto fail;
|
||||
}
|
||||
err = lock_to_ceph_filelock(lock, &flocks[l]);
|
||||
err = lock_to_ceph_filelock(inode, lock, &flocks[l]);
|
||||
if (err)
|
||||
goto fail;
|
||||
++l;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,9 +14,9 @@
|
||||
|
||||
#include <linux/ceph/types.h>
|
||||
#include <linux/ceph/messenger.h>
|
||||
#include <linux/ceph/mdsmap.h>
|
||||
#include <linux/ceph/auth.h>
|
||||
|
||||
#include "mdsmap.h"
|
||||
#include "metric.h"
|
||||
#include "super.h"
|
||||
|
||||
@@ -33,8 +33,10 @@ enum ceph_feature_type {
|
||||
CEPHFS_FEATURE_NOTIFY_SESSION_STATE,
|
||||
CEPHFS_FEATURE_OP_GETVXATTR,
|
||||
CEPHFS_FEATURE_32BITS_RETRY_FWD,
|
||||
CEPHFS_FEATURE_NEW_SNAPREALM_INFO,
|
||||
CEPHFS_FEATURE_HAS_OWNER_UIDGID,
|
||||
|
||||
CEPHFS_FEATURE_MAX = CEPHFS_FEATURE_32BITS_RETRY_FWD,
|
||||
CEPHFS_FEATURE_MAX = CEPHFS_FEATURE_HAS_OWNER_UIDGID,
|
||||
};
|
||||
|
||||
#define CEPHFS_FEATURES_CLIENT_SUPPORTED { \
|
||||
@@ -49,6 +51,7 @@ enum ceph_feature_type {
|
||||
CEPHFS_FEATURE_NOTIFY_SESSION_STATE, \
|
||||
CEPHFS_FEATURE_OP_GETVXATTR, \
|
||||
CEPHFS_FEATURE_32BITS_RETRY_FWD, \
|
||||
CEPHFS_FEATURE_HAS_OWNER_UIDGID, \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -300,6 +303,7 @@ struct ceph_mds_request {
|
||||
int r_fmode; /* file mode, if expecting cap */
|
||||
int r_request_release_offset;
|
||||
const struct cred *r_cred;
|
||||
struct mnt_idmap *r_mnt_idmap;
|
||||
struct timespec64 r_stamp;
|
||||
|
||||
/* for choosing which mds to send this request to */
|
||||
@@ -581,7 +585,8 @@ static inline void ceph_mdsc_free_path(char *path, int len)
|
||||
__putname(path - (PATH_MAX - 1 - len));
|
||||
}
|
||||
|
||||
extern char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
|
||||
extern char *ceph_mdsc_build_path(struct ceph_mds_client *mdsc,
|
||||
struct dentry *dentry, int *plen, u64 *base,
|
||||
int for_wire);
|
||||
|
||||
extern void __ceph_mdsc_drop_dentry_lease(struct dentry *dentry);
|
||||
@@ -614,4 +619,6 @@ static inline int ceph_wait_on_async_create(struct inode *inode)
|
||||
extern int ceph_wait_on_conflict_unlink(struct dentry *dentry);
|
||||
extern u64 ceph_get_deleg_ino(struct ceph_mds_session *session);
|
||||
extern int ceph_restore_deleg_ino(struct ceph_mds_session *session, u64 ino);
|
||||
|
||||
extern bool enable_unsafe_idmap;
|
||||
#endif
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <linux/ceph/mdsmap.h>
|
||||
#include <linux/ceph/messenger.h>
|
||||
#include <linux/ceph/decode.h>
|
||||
|
||||
#include "mdsmap.h"
|
||||
#include "mds_client.h"
|
||||
#include "super.h"
|
||||
|
||||
#define CEPH_MDS_IS_READY(i, ignore_laggy) \
|
||||
@@ -114,8 +115,10 @@ bad:
|
||||
* Ignore any fields we don't care about (there are quite a few of
|
||||
* them).
|
||||
*/
|
||||
struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
|
||||
struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p,
|
||||
void *end, bool msgr2)
|
||||
{
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_mdsmap *m;
|
||||
const void *start = *p;
|
||||
int i, j, n;
|
||||
@@ -233,20 +236,18 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
|
||||
*p = info_end;
|
||||
}
|
||||
|
||||
dout("mdsmap_decode %d/%d %lld mds%d.%d %s %s%s\n",
|
||||
i+1, n, global_id, mds, inc,
|
||||
ceph_pr_addr(&addr),
|
||||
ceph_mds_state_name(state),
|
||||
laggy ? "(laggy)" : "");
|
||||
doutc(cl, "%d/%d %lld mds%d.%d %s %s%s\n", i+1, n, global_id,
|
||||
mds, inc, ceph_pr_addr(&addr),
|
||||
ceph_mds_state_name(state), laggy ? "(laggy)" : "");
|
||||
|
||||
if (mds < 0 || mds >= m->possible_max_rank) {
|
||||
pr_warn("mdsmap_decode got incorrect mds(%d)\n", mds);
|
||||
pr_warn_client(cl, "got incorrect mds(%d)\n", mds);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state <= 0) {
|
||||
dout("mdsmap_decode got incorrect state(%s)\n",
|
||||
ceph_mds_state_name(state));
|
||||
doutc(cl, "got incorrect state(%s)\n",
|
||||
ceph_mds_state_name(state));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -385,16 +386,16 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
|
||||
m->m_max_xattr_size = 0;
|
||||
}
|
||||
bad_ext:
|
||||
dout("mdsmap_decode m_enabled: %d, m_damaged: %d, m_num_laggy: %d\n",
|
||||
!!m->m_enabled, !!m->m_damaged, m->m_num_laggy);
|
||||
doutc(cl, "m_enabled: %d, m_damaged: %d, m_num_laggy: %d\n",
|
||||
!!m->m_enabled, !!m->m_damaged, m->m_num_laggy);
|
||||
*p = end;
|
||||
dout("mdsmap_decode success epoch %u\n", m->m_epoch);
|
||||
doutc(cl, "success epoch %u\n", m->m_epoch);
|
||||
return m;
|
||||
nomem:
|
||||
err = -ENOMEM;
|
||||
goto out_err;
|
||||
corrupt:
|
||||
pr_err("corrupt mdsmap\n");
|
||||
pr_err_client(cl, "corrupt mdsmap\n");
|
||||
print_hex_dump(KERN_DEBUG, "mdsmap: ",
|
||||
DUMP_PREFIX_OFFSET, 16, 1,
|
||||
start, end - start, true);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <linux/bug.h>
|
||||
#include <linux/ceph/types.h>
|
||||
|
||||
struct ceph_mds_client;
|
||||
|
||||
/*
|
||||
* mds map - describe servers in the mds cluster.
|
||||
*
|
||||
@@ -65,7 +67,8 @@ static inline bool ceph_mdsmap_is_laggy(struct ceph_mdsmap *m, int w)
|
||||
}
|
||||
|
||||
extern int ceph_mdsmap_get_random_mds(struct ceph_mdsmap *m);
|
||||
struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2);
|
||||
struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p,
|
||||
void *end, bool msgr2);
|
||||
extern void ceph_mdsmap_destroy(struct ceph_mdsmap *m);
|
||||
extern bool ceph_mdsmap_is_cluster_available(struct ceph_mdsmap *m);
|
||||
|
||||
@@ -31,6 +31,7 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
|
||||
struct ceph_client_metric *m = &mdsc->metric;
|
||||
u64 nr_caps = atomic64_read(&m->total_caps);
|
||||
u32 header_len = sizeof(struct ceph_metric_header);
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_msg *msg;
|
||||
s64 sum;
|
||||
s32 items = 0;
|
||||
@@ -51,8 +52,8 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
|
||||
|
||||
msg = ceph_msg_new(CEPH_MSG_CLIENT_METRICS, len, GFP_NOFS, true);
|
||||
if (!msg) {
|
||||
pr_err("send metrics to mds%d, failed to allocate message\n",
|
||||
s->s_mds);
|
||||
pr_err_client(cl, "to mds%d, failed to allocate message\n",
|
||||
s->s_mds);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ void ceph_handle_quota(struct ceph_mds_client *mdsc,
|
||||
{
|
||||
struct super_block *sb = mdsc->fsc->sb;
|
||||
struct ceph_mds_quota *h = msg->front.iov_base;
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_vino vino;
|
||||
struct inode *inode;
|
||||
struct ceph_inode_info *ci;
|
||||
@@ -51,8 +52,8 @@ void ceph_handle_quota(struct ceph_mds_client *mdsc,
|
||||
return;
|
||||
|
||||
if (msg->front.iov_len < sizeof(*h)) {
|
||||
pr_err("%s corrupt message mds%d len %d\n", __func__,
|
||||
session->s_mds, (int)msg->front.iov_len);
|
||||
pr_err_client(cl, "corrupt message mds%d len %d\n",
|
||||
session->s_mds, (int)msg->front.iov_len);
|
||||
ceph_msg_dump(msg);
|
||||
goto out;
|
||||
}
|
||||
@@ -62,7 +63,7 @@ void ceph_handle_quota(struct ceph_mds_client *mdsc,
|
||||
vino.snap = CEPH_NOSNAP;
|
||||
inode = ceph_find_inode(sb, vino);
|
||||
if (!inode) {
|
||||
pr_warn("Failed to find inode %llu\n", vino.ino);
|
||||
pr_warn_client(cl, "failed to find inode %llx\n", vino.ino);
|
||||
goto out;
|
||||
}
|
||||
ci = ceph_inode(inode);
|
||||
@@ -85,6 +86,7 @@ find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino)
|
||||
{
|
||||
struct ceph_quotarealm_inode *qri = NULL;
|
||||
struct rb_node **node, *parent = NULL;
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
|
||||
mutex_lock(&mdsc->quotarealms_inodes_mutex);
|
||||
node = &(mdsc->quotarealms_inodes.rb_node);
|
||||
@@ -110,7 +112,7 @@ find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino)
|
||||
rb_link_node(&qri->node, parent, node);
|
||||
rb_insert_color(&qri->node, &mdsc->quotarealms_inodes);
|
||||
} else
|
||||
pr_warn("Failed to alloc quotarealms_inode\n");
|
||||
pr_warn_client(cl, "Failed to alloc quotarealms_inode\n");
|
||||
}
|
||||
mutex_unlock(&mdsc->quotarealms_inodes_mutex);
|
||||
|
||||
@@ -129,6 +131,7 @@ static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc,
|
||||
struct super_block *sb,
|
||||
struct ceph_snap_realm *realm)
|
||||
{
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_quotarealm_inode *qri;
|
||||
struct inode *in;
|
||||
|
||||
@@ -161,8 +164,8 @@ static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc,
|
||||
}
|
||||
|
||||
if (IS_ERR(in)) {
|
||||
dout("Can't lookup inode %llx (err: %ld)\n",
|
||||
realm->ino, PTR_ERR(in));
|
||||
doutc(cl, "Can't lookup inode %llx (err: %ld)\n", realm->ino,
|
||||
PTR_ERR(in));
|
||||
qri->timeout = jiffies + msecs_to_jiffies(60 * 1000); /* XXX */
|
||||
} else {
|
||||
qri->timeout = 0;
|
||||
@@ -213,6 +216,7 @@ static struct ceph_snap_realm *get_quota_realm(struct ceph_mds_client *mdsc,
|
||||
enum quota_get_realm which_quota,
|
||||
bool retry)
|
||||
{
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_inode_info *ci = NULL;
|
||||
struct ceph_snap_realm *realm, *next;
|
||||
struct inode *in;
|
||||
@@ -226,8 +230,9 @@ restart:
|
||||
if (realm)
|
||||
ceph_get_snap_realm(mdsc, realm);
|
||||
else
|
||||
pr_err_ratelimited("get_quota_realm: ino (%llx.%llx) "
|
||||
"null i_snap_realm\n", ceph_vinop(inode));
|
||||
pr_err_ratelimited_client(cl,
|
||||
"%p %llx.%llx null i_snap_realm\n",
|
||||
inode, ceph_vinop(inode));
|
||||
while (realm) {
|
||||
bool has_inode;
|
||||
|
||||
@@ -317,6 +322,7 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
|
||||
loff_t delta)
|
||||
{
|
||||
struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
|
||||
struct ceph_client *cl = mdsc->fsc->client;
|
||||
struct ceph_inode_info *ci;
|
||||
struct ceph_snap_realm *realm, *next;
|
||||
struct inode *in;
|
||||
@@ -332,8 +338,9 @@ restart:
|
||||
if (realm)
|
||||
ceph_get_snap_realm(mdsc, realm);
|
||||
else
|
||||
pr_err_ratelimited("check_quota_exceeded: ino (%llx.%llx) "
|
||||
"null i_snap_realm\n", ceph_vinop(inode));
|
||||
pr_err_ratelimited_client(cl,
|
||||
"%p %llx.%llx null i_snap_realm\n",
|
||||
inode, ceph_vinop(inode));
|
||||
while (realm) {
|
||||
bool has_inode;
|
||||
|
||||
@@ -383,7 +390,7 @@ restart:
|
||||
break;
|
||||
default:
|
||||
/* Shouldn't happen */
|
||||
pr_warn("Invalid quota check op (%d)\n", op);
|
||||
pr_warn_client(cl, "Invalid quota check op (%d)\n", op);
|
||||
exceeded = true; /* Just break the loop */
|
||||
}
|
||||
iput(in);
|
||||
|
||||
192
fs/ceph/snap.c
192
fs/ceph/snap.c
File diff suppressed because it is too large
Load Diff
@@ -44,28 +44,29 @@ static LIST_HEAD(ceph_fsc_list);
|
||||
*/
|
||||
static void ceph_put_super(struct super_block *s)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(s);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s);
|
||||
|
||||
dout("put_super\n");
|
||||
doutc(fsc->client, "begin\n");
|
||||
ceph_fscrypt_free_dummy_policy(fsc);
|
||||
ceph_mdsc_close_sessions(fsc->mdsc);
|
||||
doutc(fsc->client, "done\n");
|
||||
}
|
||||
|
||||
static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry));
|
||||
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(d_inode(dentry));
|
||||
struct ceph_mon_client *monc = &fsc->client->monc;
|
||||
struct ceph_statfs st;
|
||||
int i, err;
|
||||
u64 data_pool;
|
||||
|
||||
doutc(fsc->client, "begin\n");
|
||||
if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) {
|
||||
data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0];
|
||||
} else {
|
||||
data_pool = CEPH_NOPOOL;
|
||||
}
|
||||
|
||||
dout("statfs\n");
|
||||
err = ceph_monc_do_statfs(monc, data_pool, &st);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -113,24 +114,26 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
/* fold the fs_cluster_id into the upper bits */
|
||||
buf->f_fsid.val[1] = monc->fs_cluster_id;
|
||||
|
||||
doutc(fsc->client, "done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ceph_sync_fs(struct super_block *sb, int wait)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
struct ceph_client *cl = fsc->client;
|
||||
|
||||
if (!wait) {
|
||||
dout("sync_fs (non-blocking)\n");
|
||||
doutc(cl, "(non-blocking)\n");
|
||||
ceph_flush_dirty_caps(fsc->mdsc);
|
||||
dout("sync_fs (non-blocking) done\n");
|
||||
doutc(cl, "(non-blocking) done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
dout("sync_fs (blocking)\n");
|
||||
doutc(cl, "(blocking)\n");
|
||||
ceph_osdc_sync(&fsc->client->osdc);
|
||||
ceph_mdsc_sync(fsc->mdsc);
|
||||
dout("sync_fs (blocking) done\n");
|
||||
doutc(cl, "(blocking) done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -341,7 +344,7 @@ static int ceph_parse_source(struct fs_parameter *param, struct fs_context *fc)
|
||||
char *dev_name = param->string, *dev_name_end;
|
||||
int ret;
|
||||
|
||||
dout("%s '%s'\n", __func__, dev_name);
|
||||
dout("'%s'\n", dev_name);
|
||||
if (!dev_name || !*dev_name)
|
||||
return invalfc(fc, "Empty source");
|
||||
|
||||
@@ -413,7 +416,7 @@ static int ceph_parse_mount_param(struct fs_context *fc,
|
||||
return ret;
|
||||
|
||||
token = fs_parse(fc, ceph_mount_parameters, param, &result);
|
||||
dout("%s fs_parse '%s' token %d\n", __func__, param->key, token);
|
||||
dout("%s: fs_parse '%s' token %d\n",__func__, param->key, token);
|
||||
if (token < 0)
|
||||
return token;
|
||||
|
||||
@@ -684,7 +687,7 @@ static int compare_mount_options(struct ceph_mount_options *new_fsopt,
|
||||
*/
|
||||
static int ceph_show_options(struct seq_file *m, struct dentry *root)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(root->d_sb);
|
||||
struct ceph_mount_options *fsopt = fsc->mount_options;
|
||||
size_t pos;
|
||||
int ret;
|
||||
@@ -881,7 +884,7 @@ static void flush_fs_workqueues(struct ceph_fs_client *fsc)
|
||||
|
||||
static void destroy_fs_client(struct ceph_fs_client *fsc)
|
||||
{
|
||||
dout("destroy_fs_client %p\n", fsc);
|
||||
doutc(fsc->client, "%p\n", fsc);
|
||||
|
||||
spin_lock(&ceph_fsc_lock);
|
||||
list_del(&fsc->metric_wakeup);
|
||||
@@ -896,7 +899,7 @@ static void destroy_fs_client(struct ceph_fs_client *fsc)
|
||||
ceph_destroy_client(fsc->client);
|
||||
|
||||
kfree(fsc);
|
||||
dout("destroy_fs_client %p done\n", fsc);
|
||||
dout("%s: %p done\n", __func__, fsc);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1015,9 +1018,9 @@ static void __ceph_umount_begin(struct ceph_fs_client *fsc)
|
||||
*/
|
||||
void ceph_umount_begin(struct super_block *sb)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
|
||||
dout("ceph_umount_begin - starting forced umount\n");
|
||||
doutc(fsc->client, "starting forced umount\n");
|
||||
if (!fsc)
|
||||
return;
|
||||
fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
|
||||
@@ -1045,13 +1048,14 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
|
||||
const char *path,
|
||||
unsigned long started)
|
||||
{
|
||||
struct ceph_client *cl = fsc->client;
|
||||
struct ceph_mds_client *mdsc = fsc->mdsc;
|
||||
struct ceph_mds_request *req = NULL;
|
||||
int err;
|
||||
struct dentry *root;
|
||||
|
||||
/* open dir */
|
||||
dout("open_root_inode opening '%s'\n", path);
|
||||
doutc(cl, "opening '%s'\n", path);
|
||||
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_GETATTR, USE_ANY_MDS);
|
||||
if (IS_ERR(req))
|
||||
return ERR_CAST(req);
|
||||
@@ -1071,13 +1075,13 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
|
||||
if (err == 0) {
|
||||
struct inode *inode = req->r_target_inode;
|
||||
req->r_target_inode = NULL;
|
||||
dout("open_root_inode success\n");
|
||||
doutc(cl, "success\n");
|
||||
root = d_make_root(inode);
|
||||
if (!root) {
|
||||
root = ERR_PTR(-ENOMEM);
|
||||
goto out;
|
||||
}
|
||||
dout("open_root_inode success, root dentry is %p\n", root);
|
||||
doutc(cl, "success, root dentry is %p\n", root);
|
||||
} else {
|
||||
root = ERR_PTR(err);
|
||||
}
|
||||
@@ -1136,11 +1140,12 @@ static int ceph_apply_test_dummy_encryption(struct super_block *sb,
|
||||
static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
|
||||
struct fs_context *fc)
|
||||
{
|
||||
struct ceph_client *cl = fsc->client;
|
||||
int err;
|
||||
unsigned long started = jiffies; /* note the start time */
|
||||
struct dentry *root;
|
||||
|
||||
dout("mount start %p\n", fsc);
|
||||
doutc(cl, "mount start %p\n", fsc);
|
||||
mutex_lock(&fsc->client->mount_mutex);
|
||||
|
||||
if (!fsc->sb->s_root) {
|
||||
@@ -1163,7 +1168,7 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
dout("mount opening path '%s'\n", path);
|
||||
doutc(cl, "mount opening path '%s'\n", path);
|
||||
|
||||
ceph_fs_debugfs_init(fsc);
|
||||
|
||||
@@ -1178,7 +1183,7 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
|
||||
}
|
||||
|
||||
fsc->mount_state = CEPH_MOUNT_MOUNTED;
|
||||
dout("mount success\n");
|
||||
doutc(cl, "mount success\n");
|
||||
mutex_unlock(&fsc->client->mount_mutex);
|
||||
return root;
|
||||
|
||||
@@ -1191,9 +1196,10 @@ out:
|
||||
static int ceph_set_super(struct super_block *s, struct fs_context *fc)
|
||||
{
|
||||
struct ceph_fs_client *fsc = s->s_fs_info;
|
||||
struct ceph_client *cl = fsc->client;
|
||||
int ret;
|
||||
|
||||
dout("set_super %p\n", s);
|
||||
doutc(cl, "%p\n", s);
|
||||
|
||||
s->s_maxbytes = MAX_LFS_FILESIZE;
|
||||
|
||||
@@ -1226,31 +1232,32 @@ static int ceph_compare_super(struct super_block *sb, struct fs_context *fc)
|
||||
struct ceph_fs_client *new = fc->s_fs_info;
|
||||
struct ceph_mount_options *fsopt = new->mount_options;
|
||||
struct ceph_options *opt = new->client->options;
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
struct ceph_client *cl = fsc->client;
|
||||
|
||||
dout("ceph_compare_super %p\n", sb);
|
||||
doutc(cl, "%p\n", sb);
|
||||
|
||||
if (compare_mount_options(fsopt, opt, fsc)) {
|
||||
dout("monitor(s)/mount options don't match\n");
|
||||
doutc(cl, "monitor(s)/mount options don't match\n");
|
||||
return 0;
|
||||
}
|
||||
if ((opt->flags & CEPH_OPT_FSID) &&
|
||||
ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) {
|
||||
dout("fsid doesn't match\n");
|
||||
doutc(cl, "fsid doesn't match\n");
|
||||
return 0;
|
||||
}
|
||||
if (fc->sb_flags != (sb->s_flags & ~SB_BORN)) {
|
||||
dout("flags differ\n");
|
||||
doutc(cl, "flags differ\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) {
|
||||
dout("client is blocklisted (and CLEANRECOVER is not set)\n");
|
||||
doutc(cl, "client is blocklisted (and CLEANRECOVER is not set)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) {
|
||||
dout("client has been forcibly unmounted\n");
|
||||
doutc(cl, "client has been forcibly unmounted\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1322,9 +1329,9 @@ static int ceph_get_tree(struct fs_context *fc)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ceph_sb_to_client(sb) != fsc) {
|
||||
if (ceph_sb_to_fs_client(sb) != fsc) {
|
||||
destroy_fs_client(fsc);
|
||||
fsc = ceph_sb_to_client(sb);
|
||||
fsc = ceph_sb_to_fs_client(sb);
|
||||
dout("get_sb got existing client %p\n", fsc);
|
||||
} else {
|
||||
dout("get_sb using new client %p\n", fsc);
|
||||
@@ -1338,8 +1345,9 @@ static int ceph_get_tree(struct fs_context *fc)
|
||||
err = PTR_ERR(res);
|
||||
goto out_splat;
|
||||
}
|
||||
dout("root %p inode %p ino %llx.%llx\n", res,
|
||||
d_inode(res), ceph_vinop(d_inode(res)));
|
||||
|
||||
doutc(fsc->client, "root %p inode %p ino %llx.%llx\n", res,
|
||||
d_inode(res), ceph_vinop(d_inode(res)));
|
||||
fc->root = fsc->sb->s_root;
|
||||
return 0;
|
||||
|
||||
@@ -1377,7 +1385,7 @@ static int ceph_reconfigure_fc(struct fs_context *fc)
|
||||
struct ceph_parse_opts_ctx *pctx = fc->fs_private;
|
||||
struct ceph_mount_options *fsopt = pctx->opts;
|
||||
struct super_block *sb = fc->root->d_sb;
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
|
||||
err = ceph_apply_test_dummy_encryption(sb, fc, fsopt);
|
||||
if (err)
|
||||
@@ -1397,7 +1405,8 @@ static int ceph_reconfigure_fc(struct fs_context *fc)
|
||||
kfree(fsc->mount_options->mon_addr);
|
||||
fsc->mount_options->mon_addr = fsopt->mon_addr;
|
||||
fsopt->mon_addr = NULL;
|
||||
pr_notice("ceph: monitor addresses recorded, but not used for reconnection");
|
||||
pr_notice_client(fsc->client,
|
||||
"monitor addresses recorded, but not used for reconnection");
|
||||
}
|
||||
|
||||
sync_filesystem(sb);
|
||||
@@ -1516,11 +1525,12 @@ void ceph_dec_osd_stopping_blocker(struct ceph_mds_client *mdsc)
|
||||
|
||||
static void ceph_kill_sb(struct super_block *s)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(s);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s);
|
||||
struct ceph_client *cl = fsc->client;
|
||||
struct ceph_mds_client *mdsc = fsc->mdsc;
|
||||
bool wait;
|
||||
|
||||
dout("kill_sb %p\n", s);
|
||||
doutc(cl, "%p\n", s);
|
||||
|
||||
ceph_mdsc_pre_umount(mdsc);
|
||||
flush_fs_workqueues(fsc);
|
||||
@@ -1551,9 +1561,9 @@ static void ceph_kill_sb(struct super_block *s)
|
||||
&mdsc->stopping_waiter,
|
||||
fsc->client->options->mount_timeout);
|
||||
if (!timeleft) /* timed out */
|
||||
pr_warn("umount timed out, %ld\n", timeleft);
|
||||
pr_warn_client(cl, "umount timed out, %ld\n", timeleft);
|
||||
else if (timeleft < 0) /* killed */
|
||||
pr_warn("umount was killed, %ld\n", timeleft);
|
||||
pr_warn_client(cl, "umount was killed, %ld\n", timeleft);
|
||||
}
|
||||
|
||||
mdsc->stopping = CEPH_MDSC_STOPPING_FLUSHED;
|
||||
@@ -1572,13 +1582,13 @@ static struct file_system_type ceph_fs_type = {
|
||||
.name = "ceph",
|
||||
.init_fs_context = ceph_init_fs_context,
|
||||
.kill_sb = ceph_kill_sb,
|
||||
.fs_flags = FS_RENAME_DOES_D_MOVE,
|
||||
.fs_flags = FS_RENAME_DOES_D_MOVE | FS_ALLOW_IDMAP,
|
||||
};
|
||||
MODULE_ALIAS_FS("ceph");
|
||||
|
||||
int ceph_force_reconnect(struct super_block *sb)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
|
||||
int err = 0;
|
||||
|
||||
fsc->mount_state = CEPH_MOUNT_RECOVER;
|
||||
@@ -1671,6 +1681,11 @@ static const struct kernel_param_ops param_ops_mount_syntax = {
|
||||
module_param_cb(mount_syntax_v1, ¶m_ops_mount_syntax, &mount_support, 0444);
|
||||
module_param_cb(mount_syntax_v2, ¶m_ops_mount_syntax, &mount_support, 0444);
|
||||
|
||||
bool enable_unsafe_idmap = false;
|
||||
module_param(enable_unsafe_idmap, bool, 0644);
|
||||
MODULE_PARM_DESC(enable_unsafe_idmap,
|
||||
"Allow to use idmapped mounts with MDS without CEPHFS_FEATURE_HAS_OWNER_UIDGID");
|
||||
|
||||
module_init(init_ceph);
|
||||
module_exit(exit_ceph);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user