Other backstores open backing devices in exclusive mode, fileio should as well. Reported-by: Gris Ge <fge@xxxxxxxxxx> Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> --- drivers/target/target_core_file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 9e21005..f23e10d 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -137,7 +137,7 @@ static struct se_device *fd_create_virtdevice( * Use O_DSYNC by default instead of O_SYNC to forgo syncing * of pure timestamp updates. */ - flags = O_RDWR | O_CREAT | O_LARGEFILE | O_DSYNC; + flags = O_RDWR | O_CREAT | O_LARGEFILE | O_DSYNC | O_EXCL; file = filp_open(dev_p, flags, 0600); if (IS_ERR(file)) { -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html