Commit 9a195628 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull misc AFS fixes from David Howells:
 "Three miscellaneous fixes to the afs filesystem:

   - Remove some struct members that aren't used, aren't set or aren't
     read, plus a wake up that nothing ever waits for.

   - Actually set the AFS_SERVER_FL_HAVE_EPOCH flag so that the code
     that depends on it can work.

   - Make a couple of waits uninterruptible if they're done for an
     operation that isn't supposed to be interruptible"

* tag 'afs-fixes-20200424' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  afs: Make record checking use TASK_UNINTERRUPTIBLE when appropriate
  afs: Fix to actually set AFS_SERVER_FL_HAVE_EPOCH
  afs: Remove some unused bits
parents b4ecf26e c4bfda16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server)

	spin_lock(&server->probe_lock);

	if (!test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
	if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
		server->cm_epoch = call->epoch;
		server->probe.cm_epoch = call->epoch;
		goto out;
+1 −4
Original line number Diff line number Diff line
@@ -117,12 +117,9 @@ out:
	       (unsigned int)rtt, ret);

	have_result |= afs_fs_probe_done(server);
	if (have_result) {
		server->probe.have_result = true;
		wake_up_var(&server->probe.have_result);
	if (have_result)
		wake_up_all(&server->probe_wq);
}
}

/*
 * Probe all of a fileserver's addresses to find out the best route and to
+1 −3
Original line number Diff line number Diff line
@@ -533,12 +533,10 @@ struct afs_server {
		u32		abort_code;
		u32		cm_epoch;
		short		error;
		bool		have_result;
		bool		responded:1;
		bool		is_yfs:1;
		bool		not_yfs:1;
		bool		local_failure:1;
		bool		no_epoch:1;
		bool		cm_probed:1;
		bool		said_rebooted:1;
		bool		said_inconsistent:1;
@@ -1335,7 +1333,7 @@ extern struct afs_volume *afs_create_volume(struct afs_fs_context *);
extern void afs_activate_volume(struct afs_volume *);
extern void afs_deactivate_volume(struct afs_volume *);
extern void afs_put_volume(struct afs_cell *, struct afs_volume *);
extern int afs_check_volume_status(struct afs_volume *, struct key *);
extern int afs_check_volume_status(struct afs_volume *, struct afs_fs_cursor *);

/*
 * write.c
+3 −3
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc)
			write_unlock(&vnode->volume->servers_lock);

			set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
			error = afs_check_volume_status(vnode->volume, fc->key);
			error = afs_check_volume_status(vnode->volume, fc);
			if (error < 0)
				goto failed_set_error;

@@ -281,7 +281,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc)

			set_bit(AFS_VOLUME_WAIT, &vnode->volume->flags);
			set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
			error = afs_check_volume_status(vnode->volume, fc->key);
			error = afs_check_volume_status(vnode->volume, fc);
			if (error < 0)
				goto failed_set_error;

@@ -341,7 +341,7 @@ start:
	/* See if we need to do an update of the volume record.  Note that the
	 * volume may have moved or even have been deleted.
	 */
	error = afs_check_volume_status(vnode->volume, fc->key);
	error = afs_check_volume_status(vnode->volume, fc);
	if (error < 0)
		goto failed_set_error;

+2 −5
Original line number Diff line number Diff line
@@ -594,12 +594,9 @@ retry:
	}

	ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING,
			  TASK_INTERRUPTIBLE);
			  (fc->flags & AFS_FS_CURSOR_INTR) ?
			  TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
	if (ret == -ERESTARTSYS) {
		if (!(fc->flags & AFS_FS_CURSOR_INTR) && server->addresses) {
			_leave(" = t [intr]");
			return true;
		}
		fc->error = ret;
		_leave(" = f [intr]");
		return false;
Loading