[PATCH v2] mount.cifs: handle errors from rename() in del_mtab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new del_mtab code ignored errors from rename(). Make it handle that
error as well like it does other errors.

Cc: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 mount.cifs.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mount.cifs.c b/mount.cifs.c
index af071c1..78a4811 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1700,7 +1700,11 @@ del_mtab(char *mountpoint)
 		goto del_mtab_error;
 	}
 
-	rename(mtabtmpfile, MOUNTED);
+	if (rename(mtabtmpfile, MOUNTED)) {
+		fprintf(stderr, "del_mtab: error %d when renaming mtab in place\n", errno);
+		rc = EX_FILEIO;
+		goto del_mtab_error;
+	}
 
 del_mtab_exit:
 	unlock_mtab();
-- 
1.7.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux