Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c50e1a4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: use complete_all and wake_up_all
  ceph: Correct obvious typo of Kconfig variable "CRYPTO_AES"
  ceph: fix dentry lease release
  ceph: fix leak of dentry in ceph_init_dentry() error path
  ceph: fix pg_mapping leak on pg_temp updates
  ceph: fix d_release dop for snapdir, snapped dentries
  ceph: avoid dcache readdir for snapdir
parents d2a97a4e 03066f23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ config CEPH_FS
        tristate "Ceph distributed file system (EXPERIMENTAL)"
	depends on INET && EXPERIMENTAL
	select LIBCRC32C
	select CONFIG_CRYPTO_AES
	select CRYPTO_AES
	help
	  Choose Y or M here to include support for mounting the
	  experimental Ceph distributed file system.  Ceph is an extremely
+8 −7
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ retry:
	if (fmode >= 0)
		__ceph_get_fmode(ci, fmode);
	spin_unlock(&inode->i_lock);
	wake_up(&ci->i_cap_wq);
	wake_up_all(&ci->i_cap_wq);
	return 0;
}

@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
	}

	if (wake)
		wake_up(&ci->i_cap_wq);
		wake_up_all(&ci->i_cap_wq);

	return delayed;
}
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
	else if (flushsnaps)
		ceph_flush_snaps(ci);
	if (wake)
		wake_up(&ci->i_cap_wq);
		wake_up_all(&ci->i_cap_wq);
	if (put)
		iput(inode);
}
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
		iput(inode);
	} else if (complete_capsnap) {
		ceph_flush_snaps(ci);
		wake_up(&ci->i_cap_wq);
		wake_up_all(&ci->i_cap_wq);
	}
	if (drop_capsnap)
		iput(inode);
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
	if (queue_invalidate)
		ceph_queue_invalidate(inode);
	if (wake)
		wake_up(&ci->i_cap_wq);
		wake_up_all(&ci->i_cap_wq);

	if (check_caps == 1)
		ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY,
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
					 struct ceph_inode_info,
					 i_flushing_item)->vfs_inode);
		mdsc->num_cap_flushing--;
		wake_up(&mdsc->cap_flushing_wq);
		wake_up_all(&mdsc->cap_flushing_wq);
		dout(" inode %p now !flushing\n", inode);

		if (ci->i_dirty_caps == 0) {
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
		}
	}
	spin_unlock(&mdsc->cap_dirty_lock);
	wake_up(&ci->i_cap_wq);
	wake_up_all(&ci->i_cap_wq);

out:
	spin_unlock(&inode->i_lock);
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry,
		memcpy(*p, dentry->d_name.name, dentry->d_name.len);
		*p += dentry->d_name.len;
		rel->dname_seq = cpu_to_le32(di->lease_seq);
		__ceph_mdsc_drop_dentry_lease(dentry);
	}
	spin_unlock(&dentry->d_lock);
	return ret;
+10 −3
Original line number Diff line number Diff line
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
	spin_lock(&inode->i_lock);
	if ((filp->f_pos == 2 || fi->dentry) &&
	    !ceph_test_opt(client, NOASYNCREADDIR) &&
	    ceph_snap(inode) != CEPH_SNAPDIR &&
	    (ci->i_ceph_flags & CEPH_I_COMPLETE) &&
	    __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) {
		err = __dcache_readdir(filp, dirent, filldir);
@@ -1013,18 +1014,22 @@ out_touch:

/*
 * When a dentry is released, clear the dir I_COMPLETE if it was part
 * of the current dir gen.
 * of the current dir gen or if this is in the snapshot namespace.
 */
static void ceph_dentry_release(struct dentry *dentry)
{
	struct ceph_dentry_info *di = ceph_dentry(dentry);
	struct inode *parent_inode = dentry->d_parent->d_inode;
	u64 snapid = ceph_snap(parent_inode);

	if (parent_inode) {
	dout("dentry_release %p parent %p\n", dentry, parent_inode);

	if (parent_inode && snapid != CEPH_SNAPDIR) {
		struct ceph_inode_info *ci = ceph_inode(parent_inode);

		spin_lock(&parent_inode->i_lock);
		if (ci->i_shared_gen == di->lease_shared_gen) {
		if (ci->i_shared_gen == di->lease_shared_gen ||
		    snapid <= CEPH_MAXSNAP) {
			dout(" clearing %p complete (d_release)\n",
			     parent_inode);
			ci->i_ceph_flags &= ~CEPH_I_COMPLETE;
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = {

struct dentry_operations ceph_snapdir_dentry_ops = {
	.d_revalidate = ceph_snapdir_d_revalidate,
	.d_release = ceph_dentry_release,
};

struct dentry_operations ceph_snap_dentry_ops = {
	.d_release = ceph_dentry_release,
};
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file)
	kmem_cache_free(ceph_file_cachep, cf);

	/* wake up anyone waiting for caps on this inode */
	wake_up(&ci->i_cap_wq);
	wake_up_all(&ci->i_cap_wq);
	return 0;
}

+4 −2
Original line number Diff line number Diff line
@@ -1199,8 +1199,10 @@ retry_lookup:
				goto out;
			}
			err = ceph_init_dentry(dn);
			if (err < 0)
			if (err < 0) {
				dput(dn);
				goto out;
			}
		} else if (dn->d_inode &&
			   (ceph_ino(dn->d_inode) != vino.ino ||
			    ceph_snap(dn->d_inode) != vino.snap)) {
@@ -1499,7 +1501,7 @@ retry:
	if (wrbuffer_refs == 0)
		ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
	if (wake)
		wake_up(&ci->i_cap_wq);
		wake_up_all(&ci->i_cap_wq);
}


Loading