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

Commit c074cefc authored by Al Viro's avatar Al Viro
Browse files

Merge branch 'for-linus' into work.misc

parents ea7d4c04 e06b933e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -172,7 +172,7 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
	if (rc < 0)
	if (rc < 0)
		goto out;
		goto out;


	skip = roundup(cprm->file->f_pos - total + sz, 4) - cprm->file->f_pos;
	skip = roundup(cprm->pos - total + sz, 4) - cprm->pos;
	if (!dump_skip(cprm, skip))
	if (!dump_skip(cprm, skip))
		goto Eio;
		goto Eio;
out:
out:
+3 −3
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
					v9fs_proto_dotu(v9ses));
					v9fs_proto_dotu(v9ses));
	fid = file->private_data;
	fid = file->private_data;
	if (!fid) {
	if (!fid) {
		fid = v9fs_fid_clone(file->f_path.dentry);
		fid = v9fs_fid_clone(file_dentry(file));
		if (IS_ERR(fid))
		if (IS_ERR(fid))
			return PTR_ERR(fid);
			return PTR_ERR(fid);


@@ -100,7 +100,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
		 * because we want write after unlink usecase
		 * because we want write after unlink usecase
		 * to work.
		 * to work.
		 */
		 */
		fid = v9fs_writeback_fid(file->f_path.dentry);
		fid = v9fs_writeback_fid(file_dentry(file));
		if (IS_ERR(fid)) {
		if (IS_ERR(fid)) {
			err = PTR_ERR(fid);
			err = PTR_ERR(fid);
			mutex_unlock(&v9inode->v_mutex);
			mutex_unlock(&v9inode->v_mutex);
@@ -516,7 +516,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma)
		 * because we want write after unlink usecase
		 * because we want write after unlink usecase
		 * to work.
		 * to work.
		 */
		 */
		fid = v9fs_writeback_fid(filp->f_path.dentry);
		fid = v9fs_writeback_fid(file_dentry(filp));
		if (IS_ERR(fid)) {
		if (IS_ERR(fid)) {
			retval = PTR_ERR(fid);
			retval = PTR_ERR(fid);
			mutex_unlock(&v9inode->v_mutex);
			mutex_unlock(&v9inode->v_mutex);
+6 −2
Original line number Original line Diff line number Diff line
@@ -70,9 +70,13 @@ struct autofs_info {
};
};


#define AUTOFS_INF_EXPIRING	(1<<0) /* dentry in the process of expiring */
#define AUTOFS_INF_EXPIRING	(1<<0) /* dentry in the process of expiring */
#define AUTOFS_INF_NO_RCU	(1<<1) /* the dentry is being considered
#define AUTOFS_INF_WANT_EXPIRE	(1<<1) /* the dentry is being considered
					* for expiry, so RCU_walk is
					* for expiry, so RCU_walk is
					* not permitted
					* not permitted.  If it progresses to
					* actual expiry attempt, the flag is
					* not cleared when EXPIRING is set -
					* in that case it gets cleared only
					* when it comes to clearing EXPIRING.
					*/
					*/
#define AUTOFS_INF_PENDING	(1<<2) /* dentry pending mount */
#define AUTOFS_INF_PENDING	(1<<2) /* dentry pending mount */


+8 −19
Original line number Original line Diff line number Diff line
@@ -316,19 +316,17 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
	if (ino->flags & AUTOFS_INF_PENDING)
	if (ino->flags & AUTOFS_INF_PENDING)
		goto out;
		goto out;
	if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
	if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
		ino->flags |= AUTOFS_INF_NO_RCU;
		ino->flags |= AUTOFS_INF_WANT_EXPIRE;
		spin_unlock(&sbi->fs_lock);
		spin_unlock(&sbi->fs_lock);
		synchronize_rcu();
		synchronize_rcu();
		spin_lock(&sbi->fs_lock);
		spin_lock(&sbi->fs_lock);
		if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
		if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
			ino->flags |= AUTOFS_INF_EXPIRING;
			ino->flags |= AUTOFS_INF_EXPIRING;
			smp_mb();
			ino->flags &= ~AUTOFS_INF_NO_RCU;
			init_completion(&ino->expire_complete);
			init_completion(&ino->expire_complete);
			spin_unlock(&sbi->fs_lock);
			spin_unlock(&sbi->fs_lock);
			return root;
			return root;
		}
		}
		ino->flags &= ~AUTOFS_INF_NO_RCU;
		ino->flags &= ~AUTOFS_INF_WANT_EXPIRE;
	}
	}
out:
out:
	spin_unlock(&sbi->fs_lock);
	spin_unlock(&sbi->fs_lock);
@@ -446,7 +444,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
	while ((dentry = get_next_positive_subdir(dentry, root))) {
	while ((dentry = get_next_positive_subdir(dentry, root))) {
		spin_lock(&sbi->fs_lock);
		spin_lock(&sbi->fs_lock);
		ino = autofs4_dentry_ino(dentry);
		ino = autofs4_dentry_ino(dentry);
		if (ino->flags & AUTOFS_INF_NO_RCU)
		if (ino->flags & AUTOFS_INF_WANT_EXPIRE)
			expired = NULL;
			expired = NULL;
		else
		else
			expired = should_expire(dentry, mnt, timeout, how);
			expired = should_expire(dentry, mnt, timeout, how);
@@ -455,7 +453,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
			continue;
			continue;
		}
		}
		ino = autofs4_dentry_ino(expired);
		ino = autofs4_dentry_ino(expired);
		ino->flags |= AUTOFS_INF_NO_RCU;
		ino->flags |= AUTOFS_INF_WANT_EXPIRE;
		spin_unlock(&sbi->fs_lock);
		spin_unlock(&sbi->fs_lock);
		synchronize_rcu();
		synchronize_rcu();
		spin_lock(&sbi->fs_lock);
		spin_lock(&sbi->fs_lock);
@@ -465,7 +463,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
			goto found;
			goto found;
		}
		}


		ino->flags &= ~AUTOFS_INF_NO_RCU;
		ino->flags &= ~AUTOFS_INF_WANT_EXPIRE;
		if (expired != dentry)
		if (expired != dentry)
			dput(expired);
			dput(expired);
		spin_unlock(&sbi->fs_lock);
		spin_unlock(&sbi->fs_lock);
@@ -475,17 +473,8 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
found:
found:
	pr_debug("returning %p %pd\n", expired, expired);
	pr_debug("returning %p %pd\n", expired, expired);
	ino->flags |= AUTOFS_INF_EXPIRING;
	ino->flags |= AUTOFS_INF_EXPIRING;
	smp_mb();
	ino->flags &= ~AUTOFS_INF_NO_RCU;
	init_completion(&ino->expire_complete);
	init_completion(&ino->expire_complete);
	spin_unlock(&sbi->fs_lock);
	spin_unlock(&sbi->fs_lock);
	spin_lock(&sbi->lookup_lock);
	spin_lock(&expired->d_parent->d_lock);
	spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
	list_move(&expired->d_parent->d_subdirs, &expired->d_child);
	spin_unlock(&expired->d_lock);
	spin_unlock(&expired->d_parent->d_lock);
	spin_unlock(&sbi->lookup_lock);
	return expired;
	return expired;
}
}


@@ -496,7 +485,7 @@ int autofs4_expire_wait(struct dentry *dentry, int rcu_walk)
	int status;
	int status;


	/* Block on any pending expire */
	/* Block on any pending expire */
	if (!(ino->flags & (AUTOFS_INF_EXPIRING | AUTOFS_INF_NO_RCU)))
	if (!(ino->flags & AUTOFS_INF_WANT_EXPIRE))
		return 0;
		return 0;
	if (rcu_walk)
	if (rcu_walk)
		return -ECHILD;
		return -ECHILD;
@@ -554,7 +543,7 @@ int autofs4_expire_run(struct super_block *sb,
	ino = autofs4_dentry_ino(dentry);
	ino = autofs4_dentry_ino(dentry);
	/* avoid rapid-fire expire attempts if expiry fails */
	/* avoid rapid-fire expire attempts if expiry fails */
	ino->last_used = now;
	ino->last_used = now;
	ino->flags &= ~AUTOFS_INF_EXPIRING;
	ino->flags &= ~(AUTOFS_INF_EXPIRING|AUTOFS_INF_WANT_EXPIRE);
	complete_all(&ino->expire_complete);
	complete_all(&ino->expire_complete);
	spin_unlock(&sbi->fs_lock);
	spin_unlock(&sbi->fs_lock);


@@ -583,7 +572,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
		spin_lock(&sbi->fs_lock);
		spin_lock(&sbi->fs_lock);
		/* avoid rapid-fire expire attempts if expiry fails */
		/* avoid rapid-fire expire attempts if expiry fails */
		ino->last_used = now;
		ino->last_used = now;
		ino->flags &= ~AUTOFS_INF_EXPIRING;
		ino->flags &= ~(AUTOFS_INF_EXPIRING|AUTOFS_INF_WANT_EXPIRE);
		complete_all(&ino->expire_complete);
		complete_all(&ino->expire_complete);
		spin_unlock(&sbi->fs_lock);
		spin_unlock(&sbi->fs_lock);
		dput(dentry);
		dput(dentry);
+1 −1
Original line number Original line Diff line number Diff line
@@ -458,7 +458,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
		 */
		 */
		struct inode *inode;
		struct inode *inode;


		if (ino->flags & (AUTOFS_INF_EXPIRING | AUTOFS_INF_NO_RCU))
		if (ino->flags & AUTOFS_INF_WANT_EXPIRE)
			return 0;
			return 0;
		if (d_mountpoint(dentry))
		if (d_mountpoint(dentry))
			return 0;
			return 0;
Loading