# git rev-parse -q --verify 0d74471924f2a01dcd32d154510c0500780b531a^{commit} 0d74471924f2a01dcd32d154510c0500780b531a already have revision, skipping fetch # git checkout -q -f -B kisskb 0d74471924f2a01dcd32d154510c0500780b531a # git clean -qxdf # < git log -1 # commit 0d74471924f2a01dcd32d154510c0500780b531a # Merge: 227747fb9eab 39db9815da48 # Author: Linus Torvalds # Date: Thu May 16 17:18:41 2019 -0700 # # Merge tag 'afs-fixes-b-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs # # Pull AFS callback promise fixes from David Howells: # "This series fixes a bunch of problems in callback promise handling, # where a callback promise indicates a promise on the part of the server # to notify the client in the event of some sort of change to a file or # volume. In the event of a break, the client has to go and refetch the # client status from the server and discard any cached permission # information as the ACL might have changed. # # The problem in the current code is that changes made by other clients # aren't always noticed, primarily because the file status information # and the callback information aren't updated in the same critical # section, even if these are carried in the same reply from an RPC # operation, and so the AFS_VNODE_CB_PROMISED flag is unreliable. # # Arranging for them to be done in the same critical section during # reply decoding is tricky because of the FS.InlineBulkStatus op - which # has all the statuses in the reply arriving and then all the callbacks, # so they have to be buffered. It simplifies things a lot to move the # critical section out of the decode phase and do it after the RPC # function returns. # # Also new inodes (either newly fetched or newly created) aren't # properly managed against a callback break happening before we get the # local inode up and running. # # Fix this by: # # - There's now a combined file status and callback record (struct # afs_status_cb) to carry both plus some flags. # # - Each operation wrapper function allocates sufficient afs_status_cb # records for all the vnodes it is interested in and passes them into # RPC operations to be filled in from the reply. # # - The FileStatus and CallBack record decoders no longer apply the # new/revised status and callback information to the inode/vnode at # the point of decoding and instead store the information into the # record from (2). # # - afs_vnode_commit_status() then revises the file status, detects # deletion and notes callback information inside of a single critical # section. It also checks the callback break counters and cancels the # callback promise if they changed during the operation. # # [*] Note that "callback break counters" are counters of server # events that cancel one or more callback promises that the client # thinks it has. The client counts the events and compares the # counters before and after an operation to see if the callback # promise it thinks it just got evaporated before it got recorded # under lock. # # - Volume and server callback break counters are passed into # afs_iget() allowing callback breaks concurrent with inode set up to # be detected and the callback promise thence to be cancelled. # # - AFS validation checks are now done under RCU conditions using a # read lock on cb_lock. This requires vnode->cb_interest to be made # RCU safe. # # - If the checks in (6) fail, the callback breaker is then called # under write lock on the cb_lock - but only if the callback break # counter didn't change from the value read before the checks were # made. # # - Results from FS.InlineBulkStatus that correspond to inodes we # currently have in memory are now used to update those inodes' # status and callback information rather than being discarded. This # requires those inodes to be looked up before the RPC op is made and # all their callback break values saved. # # To aid in this, the following changes have also been made: # # - Don't pass the vnode into the reply delivery functions or the # decoders. The vnode shouldn't be altered anywhere in those paths. # The only exception, for the moment, is for the call done hook for # file lock ops that wants access to both the vnode and the call - # this can be fixed at a later time. # # - Get rid of the call->reply[] void* array and replace it with named # and typed members. This avoids confusion since different ops were # mapping different reply[] members to different things. # # - Fix an order-1 kmalloc allocation in afs_do_lookup() and replace it # with kvcalloc(). # # - Always get the reply time. Since callback, lock and fileserver # record expiry times are calculated for several RPCs, make this # mandatory. # # - Call afs_pages_written_back() from the operation wrapper rather # than from the delivery function. # # - Don't store the version and type from a callback promise in a reply # as the information in them is of very limited use" # # * tag 'afs-fixes-b-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: # afs: Fix application of the results of a inline bulk status fetch # afs: Pass pre-fetch server and volume break counts into afs_iget5_set() # afs: Fix unlink to handle YFS.RemoveFile2 better # afs: Clear AFS_VNODE_CB_PROMISED if we detect callback expiry # afs: Make vnode->cb_interest RCU safe # afs: Split afs_validate() so first part can be used under LOOKUP_RCU # afs: Don't save callback version and type fields # afs: Fix application of status and callback to be under same lock # afs: Always get the reply time # afs: Fix order-1 allocation in afs_do_lookup() # afs: Get rid of afs_call::reply[] # afs: Don't pass the vnode pointer through into the inline bulk status op # < /opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-gcc --version # < /opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-ld --version # < git log --format=%s --max-count=1 0d74471924f2a01dcd32d154510c0500780b531a # < make -s -j 8 ARCH=arm64 O=/kisskb/build/linus-rand_arm64-randconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- randconfig KCONFIG_SEED=0x63805940 # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # yes \n | make -s -j 8 ARCH=arm64 O=/kisskb/build/linus-rand_arm64-randconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- oldconfig yes: standard output: Broken pipe # make -s -j 8 ARCH=arm64 O=/kisskb/build/linus-rand_arm64-randconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- arch/arm64/Makefile:40: LSE atomics not supported by binutils arch/arm64/Makefile:40: LSE atomics not supported by binutils :1388:2: warning: #warning syscall open_tree not implemented [-Wcpp] :1391:2: warning: #warning syscall move_mount not implemented [-Wcpp] :1394:2: warning: #warning syscall fsopen not implemented [-Wcpp] :1397:2: warning: #warning syscall fsconfig not implemented [-Wcpp] :1400:2: warning: #warning syscall fsmount not implemented [-Wcpp] :1403:2: warning: #warning syscall fspick not implemented [-Wcpp] /kisskb/src/kernel/locking/lockdep.c:2820:13: warning: 'print_lock_trace' defined but not used [-Wunused-function] static void print_lock_trace(struct lock_trace *trace, unsigned int spaces) ^ /kisskb/src/drivers/hwtracing/intel_th/msu.c: In function 'msc_buffer_win_alloc': /kisskb/src/drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable 'i' [-Wunused-variable] int ret = -ENOMEM, i; ^ /kisskb/src/drivers/hwtracing/intel_th/msu.c: In function 'msc_buffer_win_free': /kisskb/src/drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable 'i' [-Wunused-variable] int i; ^ Completed OK # rm -rf /kisskb/build/linus-rand_arm64-randconfig_arm64-gcc5.4 # Build took: 0:03:40.394532