OSDN Git Service

orangefs: clean up debugfs
authorMike Marshall <hubcap@omnibond.com>
Fri, 4 Nov 2016 20:32:25 +0000 (16:32 -0400)
committerMike Marshall <hubcap@omnibond.com>
Mon, 7 Nov 2016 15:41:55 +0000 (10:41 -0500)
commitdc0336214eb07ee9de2a41dd4c81c744ffa419ac
tree56c9ca467f36588615993f2b163c29bc64109568
parent804b1737d71253f01621d2a37a0dce6279a2d440
orangefs: clean up debugfs

We recently refactored the Orangefs debugfs code.
The refactor seemed to trigger dan.carpenter@oracle.com's
static tester to find a possible double-free in the code.

While designing the fix we saw a condition under which the
buffer being freed could also be overflowed.

We also realized how to rebuild the related debugfs file's
"contents" (a string) without deleting and re-creating the file.

This fix should eliminate the possible double-free, the
potential overflow and improve code readability.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
fs/orangefs/orangefs-debugfs.c
fs/orangefs/orangefs-mod.c