aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-05-08 11:16:31 -0400
committerDavid Howells <dhowells@redhat.com>2019-05-16 11:25:20 -0400
commit20b8391fff56f64893233a772a81adc392a69121 (patch)
tree8cfb288eaca7a3afb0e13e261e24c8ecdfc91820 /fs/afs
parentb960a34b73e4c1c972623bc2076e24b97588d09e (diff)
afs: Make some RPC operations non-interruptible
Make certain RPC operations non-interruptible, including: (*) Set attributes (*) Store data We don't want to get interrupted during a flush on close, flush on unlock, writeback or an inode update, leaving us in a state where we still need to do the writeback or update. (*) Extend lock (*) Release lock We don't want to get lock extension interrupted as the file locks on the server are time-limited. Interruption during lock release is less of an issue since the lock is time-limited, but it's better to complete the release to avoid a several-minute wait to recover it. *Setting* the lock isn't a problem if it's interrupted since we can just return to the user and tell them they were interrupted - at which point they can elect to retry. (*) Silly unlink We want to remove silly unlink files if we can, rather than leaving them for the salvager to clear up. Note that whilst these calls are no longer interruptible, they do have timeouts on them, so if the server stops responding the call will fail with something like ETIME or ECONNRESET. Without this, the following: kAFS: Unexpected error from FS.StoreData -512 appears in dmesg when a pending store data gets interrupted and some processes may just hang. Additionally, make the code that checks/updates the server record ignore failure due to interruption if the main call is uninterruptible and if the server has an address list. The next op will check it again since the expiration time on the old list has past. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Reported-by: Jonathan Billings <jsbillings@jsbillings.org> Reported-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/dir.c18
-rw-r--r--fs/afs/dir_silly.c4
-rw-r--r--fs/afs/file.c2
-rw-r--r--fs/afs/flock.c6
-rw-r--r--fs/afs/fsclient.c19
-rw-r--r--fs/afs/inode.c4
-rw-r--r--fs/afs/internal.h9
-rw-r--r--fs/afs/rotate.c27
-rw-r--r--fs/afs/rxrpc.c4
-rw-r--r--fs/afs/server.c11
-rw-r--r--fs/afs/super.c2
-rw-r--r--fs/afs/write.c2
-rw-r--r--fs/afs/xattr.c8
-rw-r--r--fs/afs/yfsclient.c18
14 files changed, 99 insertions, 35 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 9a466be583d2..c15550310f62 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -704,7 +704,7 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
704 goto no_inline_bulk_status; 704 goto no_inline_bulk_status;
705 705
706 inode = ERR_PTR(-ERESTARTSYS); 706 inode = ERR_PTR(-ERESTARTSYS);
707 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 707 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
708 while (afs_select_fileserver(&fc)) { 708 while (afs_select_fileserver(&fc)) {
709 if (test_bit(AFS_SERVER_FL_NO_IBULK, 709 if (test_bit(AFS_SERVER_FL_NO_IBULK,
710 &fc.cbi->server->flags)) { 710 &fc.cbi->server->flags)) {
@@ -739,7 +739,7 @@ no_inline_bulk_status:
739 */ 739 */
740 cookie->nr_fids = 1; 740 cookie->nr_fids = 1;
741 inode = ERR_PTR(-ERESTARTSYS); 741 inode = ERR_PTR(-ERESTARTSYS);
742 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 742 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
743 while (afs_select_fileserver(&fc)) { 743 while (afs_select_fileserver(&fc)) {
744 afs_fs_fetch_status(&fc, 744 afs_fs_fetch_status(&fc,
745 afs_v2net(dvnode), 745 afs_v2net(dvnode),
@@ -1166,7 +1166,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
1166 } 1166 }
1167 1167
1168 ret = -ERESTARTSYS; 1168 ret = -ERESTARTSYS;
1169 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1169 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1170 while (afs_select_fileserver(&fc)) { 1170 while (afs_select_fileserver(&fc)) {
1171 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 1171 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
1172 afs_fs_create(&fc, dentry->d_name.name, mode, data_version, 1172 afs_fs_create(&fc, dentry->d_name.name, mode, data_version,
@@ -1250,7 +1250,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
1250 } 1250 }
1251 1251
1252 ret = -ERESTARTSYS; 1252 ret = -ERESTARTSYS;
1253 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1253 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1254 while (afs_select_fileserver(&fc)) { 1254 while (afs_select_fileserver(&fc)) {
1255 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 1255 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
1256 afs_fs_remove(&fc, vnode, dentry->d_name.name, true, 1256 afs_fs_remove(&fc, vnode, dentry->d_name.name, true,
@@ -1374,7 +1374,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
1374 spin_unlock(&dentry->d_lock); 1374 spin_unlock(&dentry->d_lock);
1375 1375
1376 ret = -ERESTARTSYS; 1376 ret = -ERESTARTSYS;
1377 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1377 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1378 while (afs_select_fileserver(&fc)) { 1378 while (afs_select_fileserver(&fc)) {
1379 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 1379 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
1380 1380
@@ -1445,7 +1445,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
1445 } 1445 }
1446 1446
1447 ret = -ERESTARTSYS; 1447 ret = -ERESTARTSYS;
1448 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1448 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1449 while (afs_select_fileserver(&fc)) { 1449 while (afs_select_fileserver(&fc)) {
1450 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 1450 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
1451 afs_fs_create(&fc, dentry->d_name.name, mode, data_version, 1451 afs_fs_create(&fc, dentry->d_name.name, mode, data_version,
@@ -1510,7 +1510,7 @@ static int afs_link(struct dentry *from, struct inode *dir,
1510 } 1510 }
1511 1511
1512 ret = -ERESTARTSYS; 1512 ret = -ERESTARTSYS;
1513 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1513 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1514 if (mutex_lock_interruptible_nested(&vnode->io_lock, 1) < 0) { 1514 if (mutex_lock_interruptible_nested(&vnode->io_lock, 1) < 0) {
1515 afs_end_vnode_operation(&fc); 1515 afs_end_vnode_operation(&fc);
1516 goto error_key; 1516 goto error_key;
@@ -1584,7 +1584,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
1584 } 1584 }
1585 1585
1586 ret = -ERESTARTSYS; 1586 ret = -ERESTARTSYS;
1587 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 1587 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1588 while (afs_select_fileserver(&fc)) { 1588 while (afs_select_fileserver(&fc)) {
1589 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 1589 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
1590 afs_fs_symlink(&fc, dentry->d_name.name, 1590 afs_fs_symlink(&fc, dentry->d_name.name,
@@ -1696,7 +1696,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
1696 } 1696 }
1697 1697
1698 ret = -ERESTARTSYS; 1698 ret = -ERESTARTSYS;
1699 if (afs_begin_vnode_operation(&fc, orig_dvnode, key)) { 1699 if (afs_begin_vnode_operation(&fc, orig_dvnode, key, true)) {
1700 if (orig_dvnode != new_dvnode) { 1700 if (orig_dvnode != new_dvnode) {
1701 if (mutex_lock_interruptible_nested(&new_dvnode->io_lock, 1) < 0) { 1701 if (mutex_lock_interruptible_nested(&new_dvnode->io_lock, 1) < 0) {
1702 afs_end_vnode_operation(&fc); 1702 afs_end_vnode_operation(&fc);
diff --git a/fs/afs/dir_silly.c b/fs/afs/dir_silly.c
index f6f89fdab6b2..fbc2d301ffe8 100644
--- a/fs/afs/dir_silly.c
+++ b/fs/afs/dir_silly.c
@@ -30,7 +30,7 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode
30 _enter("%pd,%pd", old, new); 30 _enter("%pd,%pd", old, new);
31 31
32 trace_afs_silly_rename(vnode, false); 32 trace_afs_silly_rename(vnode, false);
33 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 33 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
34 while (afs_select_fileserver(&fc)) { 34 while (afs_select_fileserver(&fc)) {
35 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 35 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
36 afs_fs_rename(&fc, old->d_name.name, 36 afs_fs_rename(&fc, old->d_name.name,
@@ -149,7 +149,7 @@ static int afs_do_silly_unlink(struct afs_vnode *dvnode, struct afs_vnode *vnode
149 _enter(""); 149 _enter("");
150 150
151 trace_afs_silly_rename(vnode, true); 151 trace_afs_silly_rename(vnode, true);
152 if (afs_begin_vnode_operation(&fc, dvnode, key)) { 152 if (afs_begin_vnode_operation(&fc, dvnode, key, false)) {
153 while (afs_select_fileserver(&fc)) { 153 while (afs_select_fileserver(&fc)) {
154 fc.cb_break = afs_calc_vnode_cb_break(dvnode); 154 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
155 155
diff --git a/fs/afs/file.c b/fs/afs/file.c
index b0a43e250a9b..f59c6149fa02 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -238,7 +238,7 @@ int afs_fetch_data(struct afs_vnode *vnode, struct key *key, struct afs_read *de
238 key_serial(key)); 238 key_serial(key));
239 239
240 ret = -ERESTARTSYS; 240 ret = -ERESTARTSYS;
241 if (afs_begin_vnode_operation(&fc, vnode, key)) { 241 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
242 while (afs_select_fileserver(&fc)) { 242 while (afs_select_fileserver(&fc)) {
243 fc.cb_break = afs_calc_vnode_cb_break(vnode); 243 fc.cb_break = afs_calc_vnode_cb_break(vnode);
244 afs_fs_fetch_data(&fc, desc); 244 afs_fs_fetch_data(&fc, desc);
diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index adc88eff7849..3501ef7ddbb4 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -196,7 +196,7 @@ static int afs_set_lock(struct afs_vnode *vnode, struct key *key,
196 key_serial(key), type); 196 key_serial(key), type);
197 197
198 ret = -ERESTARTSYS; 198 ret = -ERESTARTSYS;
199 if (afs_begin_vnode_operation(&fc, vnode, key)) { 199 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
200 while (afs_select_fileserver(&fc)) { 200 while (afs_select_fileserver(&fc)) {
201 fc.cb_break = afs_calc_vnode_cb_break(vnode); 201 fc.cb_break = afs_calc_vnode_cb_break(vnode);
202 afs_fs_set_lock(&fc, type); 202 afs_fs_set_lock(&fc, type);
@@ -227,7 +227,7 @@ static int afs_extend_lock(struct afs_vnode *vnode, struct key *key)
227 key_serial(key)); 227 key_serial(key));
228 228
229 ret = -ERESTARTSYS; 229 ret = -ERESTARTSYS;
230 if (afs_begin_vnode_operation(&fc, vnode, key)) { 230 if (afs_begin_vnode_operation(&fc, vnode, key, false)) {
231 while (afs_select_current_fileserver(&fc)) { 231 while (afs_select_current_fileserver(&fc)) {
232 fc.cb_break = afs_calc_vnode_cb_break(vnode); 232 fc.cb_break = afs_calc_vnode_cb_break(vnode);
233 afs_fs_extend_lock(&fc); 233 afs_fs_extend_lock(&fc);
@@ -258,7 +258,7 @@ static int afs_release_lock(struct afs_vnode *vnode, struct key *key)
258 key_serial(key)); 258 key_serial(key));
259 259
260 ret = -ERESTARTSYS; 260 ret = -ERESTARTSYS;
261 if (afs_begin_vnode_operation(&fc, vnode, key)) { 261 if (afs_begin_vnode_operation(&fc, vnode, key, false)) {
262 while (afs_select_current_fileserver(&fc)) { 262 while (afs_select_current_fileserver(&fc)) {
263 fc.cb_break = afs_calc_vnode_cb_break(vnode); 263 fc.cb_break = afs_calc_vnode_cb_break(vnode);
264 afs_fs_release_lock(&fc); 264 afs_fs_release_lock(&fc);
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 7051b58d8a55..d58848c357aa 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -469,6 +469,7 @@ int afs_fs_fetch_file_status(struct afs_fs_cursor *fc, struct afs_volsync *volsy
469 afs_use_fs_server(call, fc->cbi); 469 afs_use_fs_server(call, fc->cbi);
470 trace_afs_make_fs_call(call, &vnode->fid); 470 trace_afs_make_fs_call(call, &vnode->fid);
471 471
472 afs_set_fc_call(call, fc);
472 afs_make_call(&fc->ac, call, GFP_NOFS); 473 afs_make_call(&fc->ac, call, GFP_NOFS);
473 return afs_wait_for_call_to_complete(call, &fc->ac); 474 return afs_wait_for_call_to_complete(call, &fc->ac);
474} 475}
@@ -664,6 +665,7 @@ static int afs_fs_fetch_data64(struct afs_fs_cursor *fc, struct afs_read *req)
664 call->cb_break = fc->cb_break; 665 call->cb_break = fc->cb_break;
665 afs_use_fs_server(call, fc->cbi); 666 afs_use_fs_server(call, fc->cbi);
666 trace_afs_make_fs_call(call, &vnode->fid); 667 trace_afs_make_fs_call(call, &vnode->fid);
668 afs_set_fc_call(call, fc);
667 afs_make_call(&fc->ac, call, GFP_NOFS); 669 afs_make_call(&fc->ac, call, GFP_NOFS);
668 return afs_wait_for_call_to_complete(call, &fc->ac); 670 return afs_wait_for_call_to_complete(call, &fc->ac);
669} 671}
@@ -712,6 +714,7 @@ int afs_fs_fetch_data(struct afs_fs_cursor *fc, struct afs_read *req)
712 call->cb_break = fc->cb_break; 714 call->cb_break = fc->cb_break;
713 afs_use_fs_server(call, fc->cbi); 715 afs_use_fs_server(call, fc->cbi);
714 trace_afs_make_fs_call(call, &vnode->fid); 716 trace_afs_make_fs_call(call, &vnode->fid);
717 afs_set_fc_call(call, fc);
715 afs_make_call(&fc->ac, call, GFP_NOFS); 718 afs_make_call(&fc->ac, call, GFP_NOFS);
716 return afs_wait_for_call_to_complete(call, &fc->ac); 719 return afs_wait_for_call_to_complete(call, &fc->ac);
717} 720}
@@ -833,6 +836,7 @@ int afs_fs_create(struct afs_fs_cursor *fc,
833 836
834 afs_use_fs_server(call, fc->cbi); 837 afs_use_fs_server(call, fc->cbi);
835 trace_afs_make_fs_call1(call, &vnode->fid, name); 838 trace_afs_make_fs_call1(call, &vnode->fid, name);
839 afs_set_fc_call(call, fc);
836 afs_make_call(&fc->ac, call, GFP_NOFS); 840 afs_make_call(&fc->ac, call, GFP_NOFS);
837 return afs_wait_for_call_to_complete(call, &fc->ac); 841 return afs_wait_for_call_to_complete(call, &fc->ac);
838} 842}
@@ -930,6 +934,7 @@ int afs_fs_remove(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
930 934
931 afs_use_fs_server(call, fc->cbi); 935 afs_use_fs_server(call, fc->cbi);
932 trace_afs_make_fs_call1(call, &dvnode->fid, name); 936 trace_afs_make_fs_call1(call, &dvnode->fid, name);
937 afs_set_fc_call(call, fc);
933 afs_make_call(&fc->ac, call, GFP_NOFS); 938 afs_make_call(&fc->ac, call, GFP_NOFS);
934 return afs_wait_for_call_to_complete(call, &fc->ac); 939 return afs_wait_for_call_to_complete(call, &fc->ac);
935} 940}
@@ -1023,6 +1028,7 @@ int afs_fs_link(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
1023 1028
1024 afs_use_fs_server(call, fc->cbi); 1029 afs_use_fs_server(call, fc->cbi);
1025 trace_afs_make_fs_call1(call, &vnode->fid, name); 1030 trace_afs_make_fs_call1(call, &vnode->fid, name);
1031 afs_set_fc_call(call, fc);
1026 afs_make_call(&fc->ac, call, GFP_NOFS); 1032 afs_make_call(&fc->ac, call, GFP_NOFS);
1027 return afs_wait_for_call_to_complete(call, &fc->ac); 1033 return afs_wait_for_call_to_complete(call, &fc->ac);
1028} 1034}
@@ -1138,6 +1144,7 @@ int afs_fs_symlink(struct afs_fs_cursor *fc,
1138 1144
1139 afs_use_fs_server(call, fc->cbi); 1145 afs_use_fs_server(call, fc->cbi);
1140 trace_afs_make_fs_call1(call, &vnode->fid, name); 1146 trace_afs_make_fs_call1(call, &vnode->fid, name);
1147 afs_set_fc_call(call, fc);
1141 afs_make_call(&fc->ac, call, GFP_NOFS); 1148 afs_make_call(&fc->ac, call, GFP_NOFS);
1142 return afs_wait_for_call_to_complete(call, &fc->ac); 1149 return afs_wait_for_call_to_complete(call, &fc->ac);
1143} 1150}
@@ -1257,6 +1264,7 @@ int afs_fs_rename(struct afs_fs_cursor *fc,
1257 1264
1258 afs_use_fs_server(call, fc->cbi); 1265 afs_use_fs_server(call, fc->cbi);
1259 trace_afs_make_fs_call2(call, &orig_dvnode->fid, orig_name, new_name); 1266 trace_afs_make_fs_call2(call, &orig_dvnode->fid, orig_name, new_name);
1267 afs_set_fc_call(call, fc);
1260 afs_make_call(&fc->ac, call, GFP_NOFS); 1268 afs_make_call(&fc->ac, call, GFP_NOFS);
1261 return afs_wait_for_call_to_complete(call, &fc->ac); 1269 return afs_wait_for_call_to_complete(call, &fc->ac);
1262} 1270}
@@ -1362,6 +1370,7 @@ static int afs_fs_store_data64(struct afs_fs_cursor *fc,
1362 *bp++ = htonl((u32) i_size); 1370 *bp++ = htonl((u32) i_size);
1363 1371
1364 trace_afs_make_fs_call(call, &vnode->fid); 1372 trace_afs_make_fs_call(call, &vnode->fid);
1373 afs_set_fc_call(call, fc);
1365 afs_make_call(&fc->ac, call, GFP_NOFS); 1374 afs_make_call(&fc->ac, call, GFP_NOFS);
1366 return afs_wait_for_call_to_complete(call, &fc->ac); 1375 return afs_wait_for_call_to_complete(call, &fc->ac);
1367} 1376}
@@ -1439,6 +1448,7 @@ int afs_fs_store_data(struct afs_fs_cursor *fc, struct address_space *mapping,
1439 1448
1440 afs_use_fs_server(call, fc->cbi); 1449 afs_use_fs_server(call, fc->cbi);
1441 trace_afs_make_fs_call(call, &vnode->fid); 1450 trace_afs_make_fs_call(call, &vnode->fid);
1451 afs_set_fc_call(call, fc);
1442 afs_make_call(&fc->ac, call, GFP_NOFS); 1452 afs_make_call(&fc->ac, call, GFP_NOFS);
1443 return afs_wait_for_call_to_complete(call, &fc->ac); 1453 return afs_wait_for_call_to_complete(call, &fc->ac);
1444} 1454}
@@ -1538,6 +1548,7 @@ static int afs_fs_setattr_size64(struct afs_fs_cursor *fc, struct iattr *attr)
1538 1548
1539 afs_use_fs_server(call, fc->cbi); 1549 afs_use_fs_server(call, fc->cbi);
1540 trace_afs_make_fs_call(call, &vnode->fid); 1550 trace_afs_make_fs_call(call, &vnode->fid);
1551 afs_set_fc_call(call, fc);
1541 afs_make_call(&fc->ac, call, GFP_NOFS); 1552 afs_make_call(&fc->ac, call, GFP_NOFS);
1542 return afs_wait_for_call_to_complete(call, &fc->ac); 1553 return afs_wait_for_call_to_complete(call, &fc->ac);
1543} 1554}
@@ -1585,6 +1596,7 @@ static int afs_fs_setattr_size(struct afs_fs_cursor *fc, struct iattr *attr)
1585 1596
1586 afs_use_fs_server(call, fc->cbi); 1597 afs_use_fs_server(call, fc->cbi);
1587 trace_afs_make_fs_call(call, &vnode->fid); 1598 trace_afs_make_fs_call(call, &vnode->fid);
1599 afs_set_fc_call(call, fc);
1588 afs_make_call(&fc->ac, call, GFP_NOFS); 1600 afs_make_call(&fc->ac, call, GFP_NOFS);
1589 return afs_wait_for_call_to_complete(call, &fc->ac); 1601 return afs_wait_for_call_to_complete(call, &fc->ac);
1590} 1602}
@@ -1630,6 +1642,7 @@ int afs_fs_setattr(struct afs_fs_cursor *fc, struct iattr *attr)
1630 1642
1631 afs_use_fs_server(call, fc->cbi); 1643 afs_use_fs_server(call, fc->cbi);
1632 trace_afs_make_fs_call(call, &vnode->fid); 1644 trace_afs_make_fs_call(call, &vnode->fid);
1645 afs_set_fc_call(call, fc);
1633 afs_make_call(&fc->ac, call, GFP_NOFS); 1646 afs_make_call(&fc->ac, call, GFP_NOFS);
1634 return afs_wait_for_call_to_complete(call, &fc->ac); 1647 return afs_wait_for_call_to_complete(call, &fc->ac);
1635} 1648}
@@ -1815,6 +1828,7 @@ int afs_fs_get_volume_status(struct afs_fs_cursor *fc,
1815 1828
1816 afs_use_fs_server(call, fc->cbi); 1829 afs_use_fs_server(call, fc->cbi);
1817 trace_afs_make_fs_call(call, &vnode->fid); 1830 trace_afs_make_fs_call(call, &vnode->fid);
1831 afs_set_fc_call(call, fc);
1818 afs_make_call(&fc->ac, call, GFP_NOFS); 1832 afs_make_call(&fc->ac, call, GFP_NOFS);
1819 return afs_wait_for_call_to_complete(call, &fc->ac); 1833 return afs_wait_for_call_to_complete(call, &fc->ac);
1820} 1834}
@@ -1906,6 +1920,7 @@ int afs_fs_set_lock(struct afs_fs_cursor *fc, afs_lock_type_t type)
1906 1920
1907 afs_use_fs_server(call, fc->cbi); 1921 afs_use_fs_server(call, fc->cbi);
1908 trace_afs_make_fs_calli(call, &vnode->fid, type); 1922 trace_afs_make_fs_calli(call, &vnode->fid, type);
1923 afs_set_fc_call(call, fc);
1909 afs_make_call(&fc->ac, call, GFP_NOFS); 1924 afs_make_call(&fc->ac, call, GFP_NOFS);
1910 return afs_wait_for_call_to_complete(call, &fc->ac); 1925 return afs_wait_for_call_to_complete(call, &fc->ac);
1911} 1926}
@@ -1942,6 +1957,7 @@ int afs_fs_extend_lock(struct afs_fs_cursor *fc)
1942 1957
1943 afs_use_fs_server(call, fc->cbi); 1958 afs_use_fs_server(call, fc->cbi);
1944 trace_afs_make_fs_call(call, &vnode->fid); 1959 trace_afs_make_fs_call(call, &vnode->fid);
1960 afs_set_fc_call(call, fc);
1945 afs_make_call(&fc->ac, call, GFP_NOFS); 1961 afs_make_call(&fc->ac, call, GFP_NOFS);
1946 return afs_wait_for_call_to_complete(call, &fc->ac); 1962 return afs_wait_for_call_to_complete(call, &fc->ac);
1947} 1963}
@@ -1977,6 +1993,7 @@ int afs_fs_release_lock(struct afs_fs_cursor *fc)
1977 1993
1978 afs_use_fs_server(call, fc->cbi); 1994 afs_use_fs_server(call, fc->cbi);
1979 trace_afs_make_fs_call(call, &vnode->fid); 1995 trace_afs_make_fs_call(call, &vnode->fid);
1996 afs_set_fc_call(call, fc);
1980 afs_make_call(&fc->ac, call, GFP_NOFS); 1997 afs_make_call(&fc->ac, call, GFP_NOFS);
1981 return afs_wait_for_call_to_complete(call, &fc->ac); 1998 return afs_wait_for_call_to_complete(call, &fc->ac);
1982} 1999}
@@ -2211,6 +2228,7 @@ int afs_fs_fetch_status(struct afs_fs_cursor *fc,
2211 call->cb_break = fc->cb_break; 2228 call->cb_break = fc->cb_break;
2212 afs_use_fs_server(call, fc->cbi); 2229 afs_use_fs_server(call, fc->cbi);
2213 trace_afs_make_fs_call(call, fid); 2230 trace_afs_make_fs_call(call, fid);
2231 afs_set_fc_call(call, fc);
2214 afs_make_call(&fc->ac, call, GFP_NOFS); 2232 afs_make_call(&fc->ac, call, GFP_NOFS);
2215 return afs_wait_for_call_to_complete(call, &fc->ac); 2233 return afs_wait_for_call_to_complete(call, &fc->ac);
2216} 2234}
@@ -2397,6 +2415,7 @@ int afs_fs_inline_bulk_status(struct afs_fs_cursor *fc,
2397 call->cb_break = fc->cb_break; 2415 call->cb_break = fc->cb_break;
2398 afs_use_fs_server(call, fc->cbi); 2416 afs_use_fs_server(call, fc->cbi);
2399 trace_afs_make_fs_call(call, &fids[0]); 2417 trace_afs_make_fs_call(call, &fids[0]);
2418 afs_set_fc_call(call, fc);
2400 afs_make_call(&fc->ac, call, GFP_NOFS); 2419 afs_make_call(&fc->ac, call, GFP_NOFS);
2401 return afs_wait_for_call_to_complete(call, &fc->ac); 2420 return afs_wait_for_call_to_complete(call, &fc->ac);
2402} 2421}
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index f30aa5eacd39..1e630f016dc5 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -136,7 +136,7 @@ int afs_fetch_status(struct afs_vnode *vnode, struct key *key, bool new_inode)
136 vnode->flags); 136 vnode->flags);
137 137
138 ret = -ERESTARTSYS; 138 ret = -ERESTARTSYS;
139 if (afs_begin_vnode_operation(&fc, vnode, key)) { 139 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
140 while (afs_select_fileserver(&fc)) { 140 while (afs_select_fileserver(&fc)) {
141 fc.cb_break = afs_calc_vnode_cb_break(vnode); 141 fc.cb_break = afs_calc_vnode_cb_break(vnode);
142 afs_fs_fetch_file_status(&fc, NULL, new_inode); 142 afs_fs_fetch_file_status(&fc, NULL, new_inode);
@@ -617,7 +617,7 @@ int afs_setattr(struct dentry *dentry, struct iattr *attr)
617 } 617 }
618 618
619 ret = -ERESTARTSYS; 619 ret = -ERESTARTSYS;
620 if (afs_begin_vnode_operation(&fc, vnode, key)) { 620 if (afs_begin_vnode_operation(&fc, vnode, key, false)) {
621 while (afs_select_fileserver(&fc)) { 621 while (afs_select_fileserver(&fc)) {
622 fc.cb_break = afs_calc_vnode_cb_break(vnode); 622 fc.cb_break = afs_calc_vnode_cb_break(vnode);
623 afs_fs_setattr(&fc, attr); 623 afs_fs_setattr(&fc, attr);
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 4765c6716242..833fa39ee337 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -149,6 +149,7 @@ struct afs_call {
149 bool ret_reply0; /* T if should return reply[0] on success */ 149 bool ret_reply0; /* T if should return reply[0] on success */
150 bool upgrade; /* T to request service upgrade */ 150 bool upgrade; /* T to request service upgrade */
151 bool want_reply_time; /* T if want reply_time */ 151 bool want_reply_time; /* T if want reply_time */
152 bool intr; /* T if interruptible */
152 u16 service_id; /* Actual service ID (after upgrade) */ 153 u16 service_id; /* Actual service ID (after upgrade) */
153 unsigned int debug_id; /* Trace ID */ 154 unsigned int debug_id; /* Trace ID */
154 u32 operation_ID; /* operation ID for an incoming call */ 155 u32 operation_ID; /* operation ID for an incoming call */
@@ -773,6 +774,7 @@ struct afs_fs_cursor {
773#define AFS_FS_CURSOR_VNOVOL 0x0008 /* Set if seen VNOVOL */ 774#define AFS_FS_CURSOR_VNOVOL 0x0008 /* Set if seen VNOVOL */
774#define AFS_FS_CURSOR_CUR_ONLY 0x0010 /* Set if current server only (file lock held) */ 775#define AFS_FS_CURSOR_CUR_ONLY 0x0010 /* Set if current server only (file lock held) */
775#define AFS_FS_CURSOR_NO_VSLEEP 0x0020 /* Set to prevent sleep on VBUSY, VOFFLINE, ... */ 776#define AFS_FS_CURSOR_NO_VSLEEP 0x0020 /* Set to prevent sleep on VBUSY, VOFFLINE, ... */
777#define AFS_FS_CURSOR_INTR 0x0040 /* Set if op is interruptible */
776 unsigned short nr_iterations; /* Number of server iterations */ 778 unsigned short nr_iterations; /* Number of server iterations */
777}; 779};
778 780
@@ -1097,7 +1099,7 @@ static inline void afs_put_sysnames(struct afs_sysnames *sysnames) {}
1097 * rotate.c 1099 * rotate.c
1098 */ 1100 */
1099extern bool afs_begin_vnode_operation(struct afs_fs_cursor *, struct afs_vnode *, 1101extern bool afs_begin_vnode_operation(struct afs_fs_cursor *, struct afs_vnode *,
1100 struct key *); 1102 struct key *, bool);
1101extern bool afs_select_fileserver(struct afs_fs_cursor *); 1103extern bool afs_select_fileserver(struct afs_fs_cursor *);
1102extern bool afs_select_current_fileserver(struct afs_fs_cursor *); 1104extern bool afs_select_current_fileserver(struct afs_fs_cursor *);
1103extern int afs_end_vnode_operation(struct afs_fs_cursor *); 1105extern int afs_end_vnode_operation(struct afs_fs_cursor *);
@@ -1122,6 +1124,11 @@ extern void afs_send_simple_reply(struct afs_call *, const void *, size_t);
1122extern int afs_extract_data(struct afs_call *, bool); 1124extern int afs_extract_data(struct afs_call *, bool);
1123extern int afs_protocol_error(struct afs_call *, int, enum afs_eproto_cause); 1125extern int afs_protocol_error(struct afs_call *, int, enum afs_eproto_cause);
1124 1126
1127static inline void afs_set_fc_call(struct afs_call *call, struct afs_fs_cursor *fc)
1128{
1129 call->intr = fc->flags & AFS_FS_CURSOR_INTR;
1130}
1131
1125static inline void afs_extract_begin(struct afs_call *call, void *buf, size_t size) 1132static inline void afs_extract_begin(struct afs_call *call, void *buf, size_t size)
1126{ 1133{
1127 call->kvec[0].iov_base = buf; 1134 call->kvec[0].iov_base = buf;
diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c
index 838810da8d5c..52f3a9910f0d 100644
--- a/fs/afs/rotate.c
+++ b/fs/afs/rotate.c
@@ -25,7 +25,7 @@
25 * them here also using the io_lock. 25 * them here also using the io_lock.
26 */ 26 */
27bool afs_begin_vnode_operation(struct afs_fs_cursor *fc, struct afs_vnode *vnode, 27bool afs_begin_vnode_operation(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
28 struct key *key) 28 struct key *key, bool intr)
29{ 29{
30 memset(fc, 0, sizeof(*fc)); 30 memset(fc, 0, sizeof(*fc));
31 fc->vnode = vnode; 31 fc->vnode = vnode;
@@ -33,10 +33,15 @@ bool afs_begin_vnode_operation(struct afs_fs_cursor *fc, struct afs_vnode *vnode
33 fc->ac.error = SHRT_MAX; 33 fc->ac.error = SHRT_MAX;
34 fc->error = -EDESTADDRREQ; 34 fc->error = -EDESTADDRREQ;
35 35
36 if (mutex_lock_interruptible(&vnode->io_lock) < 0) { 36 if (intr) {
37 fc->error = -EINTR; 37 fc->flags |= AFS_FS_CURSOR_INTR;
38 fc->flags |= AFS_FS_CURSOR_STOP; 38 if (mutex_lock_interruptible(&vnode->io_lock) < 0) {
39 return false; 39 fc->error = -EINTR;
40 fc->flags |= AFS_FS_CURSOR_STOP;
41 return false;
42 }
43 } else {
44 mutex_lock(&vnode->io_lock);
40 } 45 }
41 46
42 if (vnode->lock_state != AFS_VNODE_LOCK_NONE) 47 if (vnode->lock_state != AFS_VNODE_LOCK_NONE)
@@ -118,10 +123,14 @@ static void afs_busy(struct afs_volume *volume, u32 abort_code)
118 */ 123 */
119static bool afs_sleep_and_retry(struct afs_fs_cursor *fc) 124static bool afs_sleep_and_retry(struct afs_fs_cursor *fc)
120{ 125{
121 msleep_interruptible(1000); 126 if (fc->flags & AFS_FS_CURSOR_INTR) {
122 if (signal_pending(current)) { 127 msleep_interruptible(1000);
123 fc->error = -ERESTARTSYS; 128 if (signal_pending(current)) {
124 return false; 129 fc->error = -ERESTARTSYS;
130 return false;
131 }
132 } else {
133 msleep(1000);
125 } 134 }
126 135
127 return true; 136 return true;
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 87763379952d..02a39e6adf63 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -417,7 +417,7 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
417 afs_wake_up_async_call : 417 afs_wake_up_async_call :
418 afs_wake_up_call_waiter), 418 afs_wake_up_call_waiter),
419 call->upgrade, 419 call->upgrade,
420 true, 420 call->intr,
421 call->debug_id); 421 call->debug_id);
422 if (IS_ERR(rxcall)) { 422 if (IS_ERR(rxcall)) {
423 ret = PTR_ERR(rxcall); 423 ret = PTR_ERR(rxcall);
@@ -653,7 +653,7 @@ long afs_wait_for_call_to_complete(struct afs_call *call,
653 break; 653 break;
654 } 654 }
655 655
656 if (timeout == 0 && 656 if (call->intr && timeout == 0 &&
657 life == last_life && signal_pending(current)) { 657 life == last_life && signal_pending(current)) {
658 if (stalled) 658 if (stalled)
659 break; 659 break;
diff --git a/fs/afs/server.c b/fs/afs/server.c
index 454c6357f51f..52c170b59cfd 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -521,6 +521,13 @@ static noinline bool afs_update_server_record(struct afs_fs_cursor *fc, struct a
521 alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key, 521 alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key,
522 &server->uuid); 522 &server->uuid);
523 if (IS_ERR(alist)) { 523 if (IS_ERR(alist)) {
524 if ((PTR_ERR(alist) == -ERESTARTSYS ||
525 PTR_ERR(alist) == -EINTR) &&
526 !(fc->flags & AFS_FS_CURSOR_INTR) &&
527 server->addresses) {
528 _leave(" = t [intr]");
529 return true;
530 }
524 fc->error = PTR_ERR(alist); 531 fc->error = PTR_ERR(alist);
525 _leave(" = f [%d]", fc->error); 532 _leave(" = f [%d]", fc->error);
526 return false; 533 return false;
@@ -574,6 +581,10 @@ retry:
574 ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING, 581 ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING,
575 TASK_INTERRUPTIBLE); 582 TASK_INTERRUPTIBLE);
576 if (ret == -ERESTARTSYS) { 583 if (ret == -ERESTARTSYS) {
584 if (!(fc->flags & AFS_FS_CURSOR_INTR) && server->addresses) {
585 _leave(" = t [intr]");
586 return true;
587 }
577 fc->error = ret; 588 fc->error = ret;
578 _leave(" = f [intr]"); 589 _leave(" = f [intr]");
579 return false; 590 return false;
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 783c68cd1a35..3df11eede7f4 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -741,7 +741,7 @@ static int afs_statfs(struct dentry *dentry, struct kstatfs *buf)
741 return PTR_ERR(key); 741 return PTR_ERR(key);
742 742
743 ret = -ERESTARTSYS; 743 ret = -ERESTARTSYS;
744 if (afs_begin_vnode_operation(&fc, vnode, key)) { 744 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
745 fc.flags |= AFS_FS_CURSOR_NO_VSLEEP; 745 fc.flags |= AFS_FS_CURSOR_NO_VSLEEP;
746 while (afs_select_fileserver(&fc)) { 746 while (afs_select_fileserver(&fc)) {
747 fc.cb_break = afs_calc_vnode_cb_break(vnode); 747 fc.cb_break = afs_calc_vnode_cb_break(vnode);
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 0122d7445fba..e669f2fae873 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -361,7 +361,7 @@ found_key:
361 _debug("USE WB KEY %u", key_serial(wbk->key)); 361 _debug("USE WB KEY %u", key_serial(wbk->key));
362 362
363 ret = -ERESTARTSYS; 363 ret = -ERESTARTSYS;
364 if (afs_begin_vnode_operation(&fc, vnode, wbk->key)) { 364 if (afs_begin_vnode_operation(&fc, vnode, wbk->key, false)) {
365 while (afs_select_fileserver(&fc)) { 365 while (afs_select_fileserver(&fc)) {
366 fc.cb_break = afs_calc_vnode_cb_break(vnode); 366 fc.cb_break = afs_calc_vnode_cb_break(vnode);
367 afs_fs_store_data(&fc, mapping, first, last, offset, to); 367 afs_fs_store_data(&fc, mapping, first, last, offset, to);
diff --git a/fs/afs/xattr.c b/fs/afs/xattr.c
index d12bcda911e1..e13b005fac42 100644
--- a/fs/afs/xattr.c
+++ b/fs/afs/xattr.c
@@ -57,7 +57,7 @@ static int afs_xattr_get_acl(const struct xattr_handler *handler,
57 return PTR_ERR(key); 57 return PTR_ERR(key);
58 58
59 ret = -ERESTARTSYS; 59 ret = -ERESTARTSYS;
60 if (afs_begin_vnode_operation(&fc, vnode, key)) { 60 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
61 while (afs_select_fileserver(&fc)) { 61 while (afs_select_fileserver(&fc)) {
62 fc.cb_break = afs_calc_vnode_cb_break(vnode); 62 fc.cb_break = afs_calc_vnode_cb_break(vnode);
63 acl = afs_fs_fetch_acl(&fc); 63 acl = afs_fs_fetch_acl(&fc);
@@ -114,7 +114,7 @@ static int afs_xattr_set_acl(const struct xattr_handler *handler,
114 memcpy(acl->data, buffer, size); 114 memcpy(acl->data, buffer, size);
115 115
116 ret = -ERESTARTSYS; 116 ret = -ERESTARTSYS;
117 if (afs_begin_vnode_operation(&fc, vnode, key)) { 117 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
118 while (afs_select_fileserver(&fc)) { 118 while (afs_select_fileserver(&fc)) {
119 fc.cb_break = afs_calc_vnode_cb_break(vnode); 119 fc.cb_break = afs_calc_vnode_cb_break(vnode);
120 afs_fs_store_acl(&fc, acl); 120 afs_fs_store_acl(&fc, acl);
@@ -178,7 +178,7 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler,
178 } 178 }
179 179
180 ret = -ERESTARTSYS; 180 ret = -ERESTARTSYS;
181 if (afs_begin_vnode_operation(&fc, vnode, key)) { 181 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
182 while (afs_select_fileserver(&fc)) { 182 while (afs_select_fileserver(&fc)) {
183 fc.cb_break = afs_calc_vnode_cb_break(vnode); 183 fc.cb_break = afs_calc_vnode_cb_break(vnode);
184 yfs_fs_fetch_opaque_acl(&fc, yacl); 184 yfs_fs_fetch_opaque_acl(&fc, yacl);
@@ -263,7 +263,7 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler,
263 memcpy(acl->data, buffer, size); 263 memcpy(acl->data, buffer, size);
264 264
265 ret = -ERESTARTSYS; 265 ret = -ERESTARTSYS;
266 if (afs_begin_vnode_operation(&fc, vnode, key)) { 266 if (afs_begin_vnode_operation(&fc, vnode, key, true)) {
267 while (afs_select_fileserver(&fc)) { 267 while (afs_select_fileserver(&fc)) {
268 fc.cb_break = afs_calc_vnode_cb_break(vnode); 268 fc.cb_break = afs_calc_vnode_cb_break(vnode);
269 yfs_fs_store_opaque_acl2(&fc, acl); 269 yfs_fs_store_opaque_acl2(&fc, acl);
diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
index d3e9e3fe0b58..3ba33d415a74 100644
--- a/fs/afs/yfsclient.c
+++ b/fs/afs/yfsclient.c
@@ -519,6 +519,7 @@ int yfs_fs_fetch_file_status(struct afs_fs_cursor *fc, struct afs_volsync *volsy
519 call->cb_break = fc->cb_break; 519 call->cb_break = fc->cb_break;
520 afs_use_fs_server(call, fc->cbi); 520 afs_use_fs_server(call, fc->cbi);
521 trace_afs_make_fs_call(call, &vnode->fid); 521 trace_afs_make_fs_call(call, &vnode->fid);
522 afs_set_fc_call(call, fc);
522 afs_make_call(&fc->ac, call, GFP_NOFS); 523 afs_make_call(&fc->ac, call, GFP_NOFS);
523 return afs_wait_for_call_to_complete(call, &fc->ac); 524 return afs_wait_for_call_to_complete(call, &fc->ac);
524} 525}
@@ -712,6 +713,7 @@ int yfs_fs_fetch_data(struct afs_fs_cursor *fc, struct afs_read *req)
712 call->cb_break = fc->cb_break; 713 call->cb_break = fc->cb_break;
713 afs_use_fs_server(call, fc->cbi); 714 afs_use_fs_server(call, fc->cbi);
714 trace_afs_make_fs_call(call, &vnode->fid); 715 trace_afs_make_fs_call(call, &vnode->fid);
716 afs_set_fc_call(call, fc);
715 afs_make_call(&fc->ac, call, GFP_NOFS); 717 afs_make_call(&fc->ac, call, GFP_NOFS);
716 return afs_wait_for_call_to_complete(call, &fc->ac); 718 return afs_wait_for_call_to_complete(call, &fc->ac);
717} 719}
@@ -813,6 +815,7 @@ int yfs_fs_create_file(struct afs_fs_cursor *fc,
813 815
814 afs_use_fs_server(call, fc->cbi); 816 afs_use_fs_server(call, fc->cbi);
815 trace_afs_make_fs_call1(call, &vnode->fid, name); 817 trace_afs_make_fs_call1(call, &vnode->fid, name);
818 afs_set_fc_call(call, fc);
816 afs_make_call(&fc->ac, call, GFP_NOFS); 819 afs_make_call(&fc->ac, call, GFP_NOFS);
817 return afs_wait_for_call_to_complete(call, &fc->ac); 820 return afs_wait_for_call_to_complete(call, &fc->ac);
818} 821}
@@ -877,6 +880,7 @@ int yfs_fs_make_dir(struct afs_fs_cursor *fc,
877 880
878 afs_use_fs_server(call, fc->cbi); 881 afs_use_fs_server(call, fc->cbi);
879 trace_afs_make_fs_call1(call, &vnode->fid, name); 882 trace_afs_make_fs_call1(call, &vnode->fid, name);
883 afs_set_fc_call(call, fc);
880 afs_make_call(&fc->ac, call, GFP_NOFS); 884 afs_make_call(&fc->ac, call, GFP_NOFS);
881 return afs_wait_for_call_to_complete(call, &fc->ac); 885 return afs_wait_for_call_to_complete(call, &fc->ac);
882} 886}
@@ -968,6 +972,7 @@ int yfs_fs_remove_file2(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
968 972
969 afs_use_fs_server(call, fc->cbi); 973 afs_use_fs_server(call, fc->cbi);
970 trace_afs_make_fs_call1(call, &dvnode->fid, name); 974 trace_afs_make_fs_call1(call, &dvnode->fid, name);
975 afs_set_fc_call(call, fc);
971 afs_make_call(&fc->ac, call, GFP_NOFS); 976 afs_make_call(&fc->ac, call, GFP_NOFS);
972 return afs_wait_for_call_to_complete(call, &fc->ac); 977 return afs_wait_for_call_to_complete(call, &fc->ac);
973} 978}
@@ -1056,6 +1061,7 @@ int yfs_fs_remove(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
1056 1061
1057 afs_use_fs_server(call, fc->cbi); 1062 afs_use_fs_server(call, fc->cbi);
1058 trace_afs_make_fs_call1(call, &dvnode->fid, name); 1063 trace_afs_make_fs_call1(call, &dvnode->fid, name);
1064 afs_set_fc_call(call, fc);
1059 afs_make_call(&fc->ac, call, GFP_NOFS); 1065 afs_make_call(&fc->ac, call, GFP_NOFS);
1060 return afs_wait_for_call_to_complete(call, &fc->ac); 1066 return afs_wait_for_call_to_complete(call, &fc->ac);
1061} 1067}
@@ -1142,6 +1148,7 @@ int yfs_fs_link(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
1142 1148
1143 afs_use_fs_server(call, fc->cbi); 1149 afs_use_fs_server(call, fc->cbi);
1144 trace_afs_make_fs_call1(call, &vnode->fid, name); 1150 trace_afs_make_fs_call1(call, &vnode->fid, name);
1151 afs_set_fc_call(call, fc);
1145 afs_make_call(&fc->ac, call, GFP_NOFS); 1152 afs_make_call(&fc->ac, call, GFP_NOFS);
1146 return afs_wait_for_call_to_complete(call, &fc->ac); 1153 return afs_wait_for_call_to_complete(call, &fc->ac);
1147} 1154}
@@ -1239,6 +1246,7 @@ int yfs_fs_symlink(struct afs_fs_cursor *fc,
1239 1246
1240 afs_use_fs_server(call, fc->cbi); 1247 afs_use_fs_server(call, fc->cbi);
1241 trace_afs_make_fs_call1(call, &dvnode->fid, name); 1248 trace_afs_make_fs_call1(call, &dvnode->fid, name);
1249 afs_set_fc_call(call, fc);
1242 afs_make_call(&fc->ac, call, GFP_NOFS); 1250 afs_make_call(&fc->ac, call, GFP_NOFS);
1243 return afs_wait_for_call_to_complete(call, &fc->ac); 1251 return afs_wait_for_call_to_complete(call, &fc->ac);
1244} 1252}
@@ -1338,6 +1346,7 @@ int yfs_fs_rename(struct afs_fs_cursor *fc,
1338 1346
1339 afs_use_fs_server(call, fc->cbi); 1347 afs_use_fs_server(call, fc->cbi);
1340 trace_afs_make_fs_call2(call, &orig_dvnode->fid, orig_name, new_name); 1348 trace_afs_make_fs_call2(call, &orig_dvnode->fid, orig_name, new_name);
1349 afs_set_fc_call(call, fc);
1341 afs_make_call(&fc->ac, call, GFP_NOFS); 1350 afs_make_call(&fc->ac, call, GFP_NOFS);
1342 return afs_wait_for_call_to_complete(call, &fc->ac); 1351 return afs_wait_for_call_to_complete(call, &fc->ac);
1343} 1352}
@@ -1445,6 +1454,7 @@ int yfs_fs_store_data(struct afs_fs_cursor *fc, struct address_space *mapping,
1445 1454
1446 afs_use_fs_server(call, fc->cbi); 1455 afs_use_fs_server(call, fc->cbi);
1447 trace_afs_make_fs_call(call, &vnode->fid); 1456 trace_afs_make_fs_call(call, &vnode->fid);
1457 afs_set_fc_call(call, fc);
1448 afs_make_call(&fc->ac, call, GFP_NOFS); 1458 afs_make_call(&fc->ac, call, GFP_NOFS);
1449 return afs_wait_for_call_to_complete(call, &fc->ac); 1459 return afs_wait_for_call_to_complete(call, &fc->ac);
1450} 1460}
@@ -1534,6 +1544,7 @@ static int yfs_fs_setattr_size(struct afs_fs_cursor *fc, struct iattr *attr)
1534 1544
1535 afs_use_fs_server(call, fc->cbi); 1545 afs_use_fs_server(call, fc->cbi);
1536 trace_afs_make_fs_call(call, &vnode->fid); 1546 trace_afs_make_fs_call(call, &vnode->fid);
1547 afs_set_fc_call(call, fc);
1537 afs_make_call(&fc->ac, call, GFP_NOFS); 1548 afs_make_call(&fc->ac, call, GFP_NOFS);
1538 return afs_wait_for_call_to_complete(call, &fc->ac); 1549 return afs_wait_for_call_to_complete(call, &fc->ac);
1539} 1550}
@@ -1578,6 +1589,7 @@ int yfs_fs_setattr(struct afs_fs_cursor *fc, struct iattr *attr)
1578 1589
1579 afs_use_fs_server(call, fc->cbi); 1590 afs_use_fs_server(call, fc->cbi);
1580 trace_afs_make_fs_call(call, &vnode->fid); 1591 trace_afs_make_fs_call(call, &vnode->fid);
1592 afs_set_fc_call(call, fc);
1581 afs_make_call(&fc->ac, call, GFP_NOFS); 1593 afs_make_call(&fc->ac, call, GFP_NOFS);
1582 return afs_wait_for_call_to_complete(call, &fc->ac); 1594 return afs_wait_for_call_to_complete(call, &fc->ac);
1583} 1595}
@@ -1767,6 +1779,7 @@ int yfs_fs_get_volume_status(struct afs_fs_cursor *fc,
1767 1779
1768 afs_use_fs_server(call, fc->cbi); 1780 afs_use_fs_server(call, fc->cbi);
1769 trace_afs_make_fs_call(call, &vnode->fid); 1781 trace_afs_make_fs_call(call, &vnode->fid);
1782 afs_set_fc_call(call, fc);
1770 afs_make_call(&fc->ac, call, GFP_NOFS); 1783 afs_make_call(&fc->ac, call, GFP_NOFS);
1771 return afs_wait_for_call_to_complete(call, &fc->ac); 1784 return afs_wait_for_call_to_complete(call, &fc->ac);
1772} 1785}
@@ -1866,6 +1879,7 @@ int yfs_fs_set_lock(struct afs_fs_cursor *fc, afs_lock_type_t type)
1866 1879
1867 afs_use_fs_server(call, fc->cbi); 1880 afs_use_fs_server(call, fc->cbi);
1868 trace_afs_make_fs_calli(call, &vnode->fid, type); 1881 trace_afs_make_fs_calli(call, &vnode->fid, type);
1882 afs_set_fc_call(call, fc);
1869 afs_make_call(&fc->ac, call, GFP_NOFS); 1883 afs_make_call(&fc->ac, call, GFP_NOFS);
1870 return afs_wait_for_call_to_complete(call, &fc->ac); 1884 return afs_wait_for_call_to_complete(call, &fc->ac);
1871} 1885}
@@ -1903,6 +1917,7 @@ int yfs_fs_extend_lock(struct afs_fs_cursor *fc)
1903 1917
1904 afs_use_fs_server(call, fc->cbi); 1918 afs_use_fs_server(call, fc->cbi);
1905 trace_afs_make_fs_call(call, &vnode->fid); 1919 trace_afs_make_fs_call(call, &vnode->fid);
1920 afs_set_fc_call(call, fc);
1906 afs_make_call(&fc->ac, call, GFP_NOFS); 1921 afs_make_call(&fc->ac, call, GFP_NOFS);
1907 return afs_wait_for_call_to_complete(call, &fc->ac); 1922 return afs_wait_for_call_to_complete(call, &fc->ac);
1908} 1923}
@@ -1939,6 +1954,7 @@ int yfs_fs_release_lock(struct afs_fs_cursor *fc)
1939 1954
1940 afs_use_fs_server(call, fc->cbi); 1955 afs_use_fs_server(call, fc->cbi);
1941 trace_afs_make_fs_call(call, &vnode->fid); 1956 trace_afs_make_fs_call(call, &vnode->fid);
1957 afs_set_fc_call(call, fc);
1942 afs_make_call(&fc->ac, call, GFP_NOFS); 1958 afs_make_call(&fc->ac, call, GFP_NOFS);
1943 return afs_wait_for_call_to_complete(call, &fc->ac); 1959 return afs_wait_for_call_to_complete(call, &fc->ac);
1944} 1960}
@@ -2028,6 +2044,7 @@ int yfs_fs_fetch_status(struct afs_fs_cursor *fc,
2028 call->cb_break = fc->cb_break; 2044 call->cb_break = fc->cb_break;
2029 afs_use_fs_server(call, fc->cbi); 2045 afs_use_fs_server(call, fc->cbi);
2030 trace_afs_make_fs_call(call, fid); 2046 trace_afs_make_fs_call(call, fid);
2047 afs_set_fc_call(call, fc);
2031 afs_make_call(&fc->ac, call, GFP_NOFS); 2048 afs_make_call(&fc->ac, call, GFP_NOFS);
2032 return afs_wait_for_call_to_complete(call, &fc->ac); 2049 return afs_wait_for_call_to_complete(call, &fc->ac);
2033} 2050}
@@ -2212,6 +2229,7 @@ int yfs_fs_inline_bulk_status(struct afs_fs_cursor *fc,
2212 call->cb_break = fc->cb_break; 2229 call->cb_break = fc->cb_break;
2213 afs_use_fs_server(call, fc->cbi); 2230 afs_use_fs_server(call, fc->cbi);
2214 trace_afs_make_fs_call(call, &fids[0]); 2231 trace_afs_make_fs_call(call, &fids[0]);
2232 afs_set_fc_call(call, fc);
2215 afs_make_call(&fc->ac, call, GFP_NOFS); 2233 afs_make_call(&fc->ac, call, GFP_NOFS);
2216 return afs_wait_for_call_to_complete(call, &fc->ac); 2234 return afs_wait_for_call_to_complete(call, &fc->ac);
2217} 2235}