[PATCH 3/3] libfrog: enforce dir XOR blkdev in __fs_table_lookup_mount

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

 



It's not valid to call fs_table_lookup_mount with both
dir and blkdev set, but one of them must be supplied.
Doing otherwise is a programming error, so catch it
with an ASSERT.

Fixes-coverity-id: 1433615
Fixes-coverity-id: 1433616
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/libfrog/paths.c b/libfrog/paths.c
index 318b48f..55cb284 100644
--- a/libfrog/paths.c
+++ b/libfrog/paths.c
@@ -98,6 +98,10 @@ __fs_table_lookup_mount(
 	char		rpath[PATH_MAX];
 	char		dpath[PATH_MAX];
 
+	/* There can be only one! */
+	ASSERT(dir || blkdev);
+	ASSERT(!(dir && blkdev));
+
 	if (dir && !realpath(dir, dpath))
 		return NULL;
 	if (blkdev && !realpath(blkdev, dpath))

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




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux