Skip to content

Commit 9a19562

Browse files
committed
Merge tag 'afs-fixes-20200424' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
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
2 parents b4ecf26 + c4bfda1 commit 9a19562

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

fs/afs/cmservice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server)
169169

170170
spin_lock(&server->probe_lock);
171171

172-
if (!test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
172+
if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
173173
server->cm_epoch = call->epoch;
174174
server->probe.cm_epoch = call->epoch;
175175
goto out;

fs/afs/fs_probe.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,8 @@ void afs_fileserver_probe_result(struct afs_call *call)
117117
(unsigned int)rtt, ret);
118118

119119
have_result |= afs_fs_probe_done(server);
120-
if (have_result) {
121-
server->probe.have_result = true;
122-
wake_up_var(&server->probe.have_result);
120+
if (have_result)
123121
wake_up_all(&server->probe_wq);
124-
}
125122
}
126123

127124
/*

fs/afs/internal.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,10 @@ struct afs_server {
533533
u32 abort_code;
534534
u32 cm_epoch;
535535
short error;
536-
bool have_result;
537536
bool responded:1;
538537
bool is_yfs:1;
539538
bool not_yfs:1;
540539
bool local_failure:1;
541-
bool no_epoch:1;
542540
bool cm_probed:1;
543541
bool said_rebooted:1;
544542
bool said_inconsistent:1;
@@ -1335,7 +1333,7 @@ extern struct afs_volume *afs_create_volume(struct afs_fs_context *);
13351333
extern void afs_activate_volume(struct afs_volume *);
13361334
extern void afs_deactivate_volume(struct afs_volume *);
13371335
extern void afs_put_volume(struct afs_cell *, struct afs_volume *);
1338-
extern int afs_check_volume_status(struct afs_volume *, struct key *);
1336+
extern int afs_check_volume_status(struct afs_volume *, struct afs_fs_cursor *);
13391337

13401338
/*
13411339
* write.c

fs/afs/rotate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc)
192192
write_unlock(&vnode->volume->servers_lock);
193193

194194
set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
195-
error = afs_check_volume_status(vnode->volume, fc->key);
195+
error = afs_check_volume_status(vnode->volume, fc);
196196
if (error < 0)
197197
goto failed_set_error;
198198

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

282282
set_bit(AFS_VOLUME_WAIT, &vnode->volume->flags);
283283
set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
284-
error = afs_check_volume_status(vnode->volume, fc->key);
284+
error = afs_check_volume_status(vnode->volume, fc);
285285
if (error < 0)
286286
goto failed_set_error;
287287

@@ -341,7 +341,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc)
341341
/* See if we need to do an update of the volume record. Note that the
342342
* volume may have moved or even have been deleted.
343343
*/
344-
error = afs_check_volume_status(vnode->volume, fc->key);
344+
error = afs_check_volume_status(vnode->volume, fc);
345345
if (error < 0)
346346
goto failed_set_error;
347347

fs/afs/server.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,9 @@ bool afs_check_server_record(struct afs_fs_cursor *fc, struct afs_server *server
594594
}
595595

596596
ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING,
597-
TASK_INTERRUPTIBLE);
597+
(fc->flags & AFS_FS_CURSOR_INTR) ?
598+
TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
598599
if (ret == -ERESTARTSYS) {
599-
if (!(fc->flags & AFS_FS_CURSOR_INTR) && server->addresses) {
600-
_leave(" = t [intr]");
601-
return true;
602-
}
603600
fc->error = ret;
604601
_leave(" = f [intr]");
605602
return false;

fs/afs/vl_rotate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc)
302302
pr_notice("VC: - nr=%u/%u/%u pf=%u\n",
303303
a->nr_ipv4, a->nr_addrs, a->max_addrs,
304304
a->preferred);
305-
pr_notice("VC: - pr=%lx R=%lx F=%lx\n",
306-
a->probed, a->responded, a->failed);
305+
pr_notice("VC: - R=%lx F=%lx\n",
306+
a->responded, a->failed);
307307
if (a == vc->ac.alist)
308308
pr_notice("VC: - current\n");
309309
}

fs/afs/volume.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static int afs_update_volume_status(struct afs_volume *volume, struct key *key)
281281
/*
282282
* Make sure the volume record is up to date.
283283
*/
284-
int afs_check_volume_status(struct afs_volume *volume, struct key *key)
284+
int afs_check_volume_status(struct afs_volume *volume, struct afs_fs_cursor *fc)
285285
{
286286
time64_t now = ktime_get_real_seconds();
287287
int ret, retries = 0;
@@ -299,7 +299,7 @@ int afs_check_volume_status(struct afs_volume *volume, struct key *key)
299299
}
300300

301301
if (!test_and_set_bit_lock(AFS_VOLUME_UPDATING, &volume->flags)) {
302-
ret = afs_update_volume_status(volume, key);
302+
ret = afs_update_volume_status(volume, fc->key);
303303
clear_bit_unlock(AFS_VOLUME_WAIT, &volume->flags);
304304
clear_bit_unlock(AFS_VOLUME_UPDATING, &volume->flags);
305305
wake_up_bit(&volume->flags, AFS_VOLUME_WAIT);
@@ -312,7 +312,9 @@ int afs_check_volume_status(struct afs_volume *volume, struct key *key)
312312
return 0;
313313
}
314314

315-
ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT, TASK_INTERRUPTIBLE);
315+
ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT,
316+
(fc->flags & AFS_FS_CURSOR_INTR) ?
317+
TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
316318
if (ret == -ERESTARTSYS) {
317319
_leave(" = %d", ret);
318320
return ret;

0 commit comments

Comments
 (0)