OSDN Git Service

e4defrag: don't crash if umounts the filesystem races with us
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Dec 2013 18:07:33 +0000 (13:07 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 12 Dec 2013 18:07:34 +0000 (13:07 -0500)
commite661d2815194d6db3f3e38223277569ad55bb420
tree8a2cda37b58055615de64f7734f3340a8f5eec82
parent80a1806d617fdb14421ac6ac50a640ac1fd303b3
e4defrag: don't crash if umounts the filesystem races with us

If someone umounts the filesystem between statfs64() and the getmntent()
iteration, we can exit the loop having never set mnt_type, and strcmp
can crash.  Fix the potential NULL dereference.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/e4defrag.c