From d6ea973022fb2a73ccfddb584a34b793b12043d1 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 26 Feb 2013 11:55:32 +0000 Subject: [PATCH] fs: Catch pioctl failure in mkmount If the VIOC_FILE_CELL_NAME pioctl fails in fs mkmount, return an error to the caller, instead of ploughing on with potentially bad data. Caught by coverity (#988418) Reviewed-on: http://gerrit.openafs.org/9267 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Derrick Brashear (cherry picked from commit 3ad7ba106dea28277b9e1f7a7370ba17b9fb3d17) Change-Id: I239ff7e567b01ecbec0314ec61f79d2fd0064de7 Reviewed-on: http://gerrit.openafs.org/11008 Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Stephan Wiesand --- src/venus/fs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/venus/fs.c b/src/venus/fs.c index ba4776d80..13d6585c4 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -1887,9 +1887,13 @@ defect #3069 blob.in_size = 0; blob.out_size = AFS_PIOCTL_MAXSIZE; blob.out = space; - code = - pioctl(Parent(as->parms[0].items->data), VIOC_FILE_CELL_NAME, - &blob, 1); + code = pioctl(Parent(as->parms[0].items->data), VIOC_FILE_CELL_NAME, + &blob, 1); + if (code) { + fprintf(stderr, + "%s: couldn't get cell name for file's parent\n", pn); + return 1; + } } code = GetCellName(cellName ? cellName : space, &info); -- 2.39.5