]> Git Repo - linux.git/commitdiff
Merge tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton...
authorLinus Torvalds <[email protected]>
Fri, 28 Dec 2018 01:12:30 +0000 (17:12 -0800)
committerLinus Torvalds <[email protected]>
Fri, 28 Dec 2018 01:12:30 +0000 (17:12 -0800)
Pull file locking updates from Jeff Layton:
 "The main change in this set is Neil Brown's work to reduce the
  thundering herd problem when a heavily-contended file lock is
  released.

  Previously we'd always wake up all waiters when this occurred. With
  this set, we'll now we only wake up waiters that were blocked on the
  range being released"

* tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  locks: Use inode_is_open_for_write
  fs/locks: remove unnecessary white space.
  fs/locks: merge posix_unblock_lock() and locks_delete_block()
  fs/locks: create a tree of dependent requests.
  fs/locks: change all *_conflict() functions to return bool.
  fs/locks: always delete_block after waiting.
  fs/locks: allow a lock request to block other requests.
  fs/locks: use properly initialized file_lock when unlocking.
  ocfs2: properly initial file_lock used for unlock.
  gfs2: properly initial file_lock used for unlock.
  NFS: use locks_copy_lock() to copy locks.
  fs/locks: split out __locks_wake_up_blocks().
  fs/locks: rename some lists and pointers.

1  2 
fs/cifs/file.c

diff --combined fs/cifs/file.c
index c9bc56b1baac2deac379103f1a4a32da45747b9c,94c3575e850c4a1d0e13ddd80145aca36bf5db2e..6706328ce03f89fc3eabc82f6b01779011c533c5
@@@ -1103,10 -1103,10 +1103,10 @@@ try_again
        rc = posix_lock_file(file, flock, NULL);
        up_write(&cinode->lock_sem);
        if (rc == FILE_LOCK_DEFERRED) {
-               rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next);
+               rc = wait_event_interruptible(flock->fl_wait, !flock->fl_blocker);
                if (!rc)
                        goto try_again;
-               posix_unblock_lock(flock);
+               locks_delete_block(flock);
        }
        return rc;
  }
@@@ -2541,13 -2541,14 +2541,13 @@@ static in
  cifs_resend_wdata(struct cifs_writedata *wdata, struct list_head *wdata_list,
        struct cifs_aio_ctx *ctx)
  {
 -      int wait_retry = 0;
        unsigned int wsize, credits;
        int rc;
        struct TCP_Server_Info *server =
                tlink_tcon(wdata->cfile->tlink)->ses->server;
  
        /*
 -       * Try to resend this wdata, waiting for credits up to 3 seconds.
 +       * Wait for credits to resend this wdata.
         * Note: we are attempting to resend the whole wdata not in segments
         */
        do {
                        server, wdata->bytes, &wsize, &credits);
  
                if (rc)
 -                      break;
 +                      goto out;
  
                if (wsize < wdata->bytes) {
                        add_credits_and_wake_if(server, credits, 0);
                        msleep(1000);
 -                      wait_retry++;
                }
 -      } while (wsize < wdata->bytes && wait_retry < 3);
 -
 -      if (wsize < wdata->bytes) {
 -              rc = -EBUSY;
 -              goto out;
 -      }
 +      } while (wsize < wdata->bytes);
  
        rc = -EAGAIN;
        while (rc == -EAGAIN) {
@@@ -3227,13 -3234,14 +3227,13 @@@ static int cifs_resend_rdata(struct cif
                        struct list_head *rdata_list,
                        struct cifs_aio_ctx *ctx)
  {
 -      int wait_retry = 0;
        unsigned int rsize, credits;
        int rc;
        struct TCP_Server_Info *server =
                tlink_tcon(rdata->cfile->tlink)->ses->server;
  
        /*
 -       * Try to resend this rdata, waiting for credits up to 3 seconds.
 +       * Wait for credits to resend this rdata.
         * Note: we are attempting to resend the whole rdata not in segments
         */
        do {
                                                &rsize, &credits);
  
                if (rc)
 -                      break;
 +                      goto out;
  
                if (rsize < rdata->bytes) {
                        add_credits_and_wake_if(server, credits, 0);
                        msleep(1000);
 -                      wait_retry++;
                }
 -      } while (rsize < rdata->bytes && wait_retry < 3);
 -
 -      /*
 -       * If we can't find enough credits to send this rdata
 -       * release the rdata and return failure, this will pass
 -       * whatever I/O amount we have finished to VFS.
 -       */
 -      if (rsize < rdata->bytes) {
 -              rc = -EBUSY;
 -              goto out;
 -      }
 +      } while (rsize < rdata->bytes);
  
        rc = -EAGAIN;
        while (rc == -EAGAIN) {
This page took 0.082308 seconds and 4 git commands to generate.