diff options
author | David Howells <dhowells@redhat.com> | 2020-04-16 19:17:13 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-04-24 17:33:32 +0200 |
commit | c4bfda16d1b40d1c5941c61b5aa336bdd2d9904a (patch) | |
tree | 4072cea58ebb9e178ee96fa53818e5b20669f2a6 /fs/afs/volume.c | |
parent | afs: Fix to actually set AFS_SERVER_FL_HAVE_EPOCH (diff) | |
download | linux-c4bfda16d1b40d1c5941c61b5aa336bdd2d9904a.tar.xz linux-c4bfda16d1b40d1c5941c61b5aa336bdd2d9904a.zip |
afs: Make record checking use TASK_UNINTERRUPTIBLE when appropriate
When an operation is meant to be done uninterruptibly (such as
FS.StoreData), we should not be allowing volume and server record checking
to be interrupted.
Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/afs/volume.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/afs/volume.c b/fs/afs/volume.c index 92ca5e27573b..4310336b9bb8 100644 --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -281,7 +281,7 @@ error: /* * Make sure the volume record is up to date. */ -int afs_check_volume_status(struct afs_volume *volume, struct key *key) +int afs_check_volume_status(struct afs_volume *volume, struct afs_fs_cursor *fc) { time64_t now = ktime_get_real_seconds(); int ret, retries = 0; @@ -299,7 +299,7 @@ retry: } if (!test_and_set_bit_lock(AFS_VOLUME_UPDATING, &volume->flags)) { - ret = afs_update_volume_status(volume, key); + ret = afs_update_volume_status(volume, fc->key); clear_bit_unlock(AFS_VOLUME_WAIT, &volume->flags); clear_bit_unlock(AFS_VOLUME_UPDATING, &volume->flags); wake_up_bit(&volume->flags, AFS_VOLUME_WAIT); @@ -312,7 +312,9 @@ retry: return 0; } - ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT, TASK_INTERRUPTIBLE); + ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT, + (fc->flags & AFS_FS_CURSOR_INTR) ? + TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); if (ret == -ERESTARTSYS) { _leave(" = %d", ret); return ret; |