All of lore.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl, firmware-update: kill usage of flock() in verify_fw_file()
@ 2018-02-23  6:59 Dan Williams
  2018-02-23 20:43 ` Ross Zwisler
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Williams @ 2018-02-23  6:59 UTC (permalink / raw)
  To: linux-nvdimm

It serves no purpose, we never explicitly unlock it, and it causes
needless failures if the firmware file happens to be on a filesystem
that does not support file locks.

Cc: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/update.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/ndctl/update.c b/ndctl/update.c
index 4ca6a0d0f744..0f0f0d8172c4 100644
--- a/ndctl/update.c
+++ b/ndctl/update.c
@@ -470,12 +470,6 @@ static int verify_fw_file(struct update_context *uctx)
 	if (uctx->fw_fd < 0)
 		return -errno;
 
-	rc = flock(uctx->fw_fd, LOCK_EX | LOCK_NB);
-	if (rc < 0) {
-		rc = -errno;
-		goto cleanup;
-	}
-
 	if (fstat(uctx->fw_fd, &st) < 0) {
 		rc = -errno;
 		goto cleanup;

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [ndctl PATCH] ndctl, firmware-update: kill usage of flock() in verify_fw_file()
  2018-02-23  6:59 [ndctl PATCH] ndctl, firmware-update: kill usage of flock() in verify_fw_file() Dan Williams
@ 2018-02-23 20:43 ` Ross Zwisler
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Zwisler @ 2018-02-23 20:43 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-nvdimm

On Thu, Feb 22, 2018 at 10:59:27PM -0800, Dan Williams wrote:
> It serves no purpose, we never explicitly unlock it, and it causes
> needless failures if the firmware file happens to be on a filesystem
> that does not support file locks.
> 
> Cc: Dave Jiang <dave.jiang@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Yay, I was hitting this as well in my setup which uses NFS, but wasn't sure if
the flock was necessary.

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-23 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-23  6:59 [ndctl PATCH] ndctl, firmware-update: kill usage of flock() in verify_fw_file() Dan Williams
2018-02-23 20:43 ` Ross Zwisler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.