Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'afs-fixes-20231124' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull AFS fixes from David Howells:

- Fix the afs_server_list struct to be cleaned up with RCU

- Fix afs to translate a no-data result from a DNS lookup into ENOENT,
not EDESTADDRREQ for consistency with OpenAFS

- Fix afs to translate a negative DNS lookup result into ENOENT rather
than EDESTADDRREQ

- Fix file locking on R/O volumes to operate in local mode as the
server doesn't handle exclusive locks on such files

- Set SB_RDONLY on superblocks for RO and Backup volumes so that the
VFS can see that they're read only

* tag 'afs-fixes-20231124' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
afs: Mark a superblock for an R/O or Backup volume as SB_RDONLY
afs: Fix file locking on R/O volumes to operate in local mode
afs: Return ENOENT if no cell DNS record can be found
afs: Make error on cell lookup failure consistent with OpenAFS
afs: Fix afs_server_list to be cleaned up with RCU

+18 -3
+2 -2
fs/afs/dynroot.c
··· 132 132 133 133 ret = dns_query(net->net, "afsdb", name, len, "srv=1", 134 134 NULL, NULL, false); 135 - if (ret == -ENODATA) 136 - ret = -EDESTADDRREQ; 135 + if (ret == -ENODATA || ret == -ENOKEY) 136 + ret = -ENOENT; 137 137 return ret; 138 138 } 139 139
+1
fs/afs/internal.h
··· 553 553 }; 554 554 555 555 struct afs_server_list { 556 + struct rcu_head rcu; 556 557 afs_volid_t vids[AFS_MAXTYPES]; /* Volume IDs */ 557 558 refcount_t usage; 558 559 unsigned char nr_servers;
+1 -1
fs/afs/server_list.c
··· 17 17 for (i = 0; i < slist->nr_servers; i++) 18 18 afs_unuse_server(net, slist->servers[i].server, 19 19 afs_server_trace_put_slist); 20 - kfree(slist); 20 + kfree_rcu(slist, rcu); 21 21 } 22 22 } 23 23
+4
fs/afs/super.c
··· 407 407 return PTR_ERR(volume); 408 408 409 409 ctx->volume = volume; 410 + if (volume->type != AFSVL_RWVOL) { 411 + ctx->flock_mode = afs_flock_mode_local; 412 + fc->sb_flags |= SB_RDONLY; 413 + } 410 414 } 411 415 412 416 return 0;
+10
fs/afs/vl_rotate.c
··· 58 58 } 59 59 60 60 /* Status load is ordered after lookup counter load */ 61 + if (cell->dns_status == DNS_LOOKUP_GOT_NOT_FOUND) { 62 + pr_warn("No record of cell %s\n", cell->name); 63 + vc->error = -ENOENT; 64 + return false; 65 + } 66 + 61 67 if (cell->dns_source == DNS_RECORD_UNAVAILABLE) { 62 68 vc->error = -EDESTADDRREQ; 63 69 return false; ··· 291 285 */ 292 286 static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc) 293 287 { 288 + struct afs_cell *cell = vc->cell; 294 289 static int count; 295 290 int i; 296 291 ··· 301 294 302 295 rcu_read_lock(); 303 296 pr_notice("EDESTADDR occurred\n"); 297 + pr_notice("CELL: %s err=%d\n", cell->name, cell->error); 298 + pr_notice("DNS: src=%u st=%u lc=%x\n", 299 + cell->dns_source, cell->dns_status, cell->dns_lookup_count); 304 300 pr_notice("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n", 305 301 vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error); 306 302