linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yangerkun <yangerkun@huawei.com>
To: <sfrench@samba.org>, <jlayton@kernel.org>, <neilb@suse.de>,
	<neilb@suse.com>
Cc: <linux-cifs@vger.kernel.org>, <samba-technical@lists.samba.org>,
	<linux-fsdevel@vger.kernel.org>
Subject: [PATCH] cifs: remove the retry in cifs_poxis_lock_set
Date: Wed, 24 Jun 2020 15:10:53 +0800	[thread overview]
Message-ID: <20200624071053.993784-1-yangerkun@huawei.com> (raw)

The caller of cifs_posix_lock_set will do retry(like
fcntl_setlk64->do_lock_file_wait) if we will wait for any file_lock.
So the retry in cifs_poxis_lock_set seems duplicated, remove it to
make a cleanup.

Signed-off-by: yangerkun <yangerkun@huawei.com>
---
 fs/cifs/file.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 9b0f8f33f832..2c9c24b1805d 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1162,7 +1162,6 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
 	if ((flock->fl_flags & FL_POSIX) == 0)
 		return rc;
 
-try_again:
 	cifs_down_write(&cinode->lock_sem);
 	if (!cinode->can_cache_brlcks) {
 		up_write(&cinode->lock_sem);
@@ -1171,13 +1170,6 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
 
 	rc = posix_lock_file(file, flock, NULL);
 	up_write(&cinode->lock_sem);
-	if (rc == FILE_LOCK_DEFERRED) {
-		rc = wait_event_interruptible(flock->fl_wait,
-					list_empty(&flock->fl_blocked_member));
-		if (!rc)
-			goto try_again;
-		locks_delete_block(flock);
-	}
 	return rc;
 }
 
-- 
2.25.4


             reply	other threads:[~2020-06-24  7:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  7:10 yangerkun [this message]
2020-06-30 12:24 ` [PATCH] cifs: remove the retry in cifs_poxis_lock_set yangerkun
2020-06-30 22:34   ` NeilBrown
2020-07-01  1:24     ` yangerkun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200624071053.993784-1-yangerkun@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=neilb@suse.de \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).