|To:||Eric Sandeen <sandeen@xxxxxxxxxxx>|
|Subject:||Re: [PATCH] xfs: shutdown filesystem if xfs_perag_get fails|
|From:||Mark Tinguely <tinguely@xxxxxxx>|
|Date:||Mon, 22 Apr 2013 08:45:02 -0500|
|References:||<20130419204102.736961610@xxxxxxx> <20130421174107.007313126@xxxxxxx> <5174603A.8030208@xxxxxxxxxxx>|
|User-agent:||Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0|
On 04/21/13 16:55, Eric Sandeen wrote:
On 4/21/13 12:41 PM, Mark Tinguely wrote:This problem happened locally with a bad inode number from xfs recovery. xfs_perag_get() can return NULL if given a bad agno. Most callers of xfs_perag_get() do not check for a NULL before using the pointer. This patch forces a shutdown of the filesystem for those callers that do not check the return value rather than crashing on a dereferenced NULL pointer.Hi Mark - I'm curious, what was the callchain when this happened? Was it during recovery? If so, would aborting recovery be more prudent? I might be missing something, but I'm not sure how shutting down avoids a subsequent null ptr deref& crash. i.e. if a caller does something like: pag = xfs_perag_get(mp, agno); spin_lock(&pag->pagb_lock); shutting down in xfs_perag_get doesn't save us from a null pag pointer, would it? Thanks, -Eric
You are correct, we have to exit the routine(s) to avoid the dereference. Let the callers handle the error.
Sorry for the noise. --Mark.
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||[V2] xfsprogs: xfs_quota allow user or group names beginning with digits, rjohnston|
|Next by Date:||Re: [PATCH V3] xfstests: fix common filter include in filter.btrfs, Rich Johnston|
|Previous by Thread:||Re: [PATCH] xfs: shutdown filesystem if xfs_perag_get fails, Eric Sandeen|
|Next by Thread:||Re: [PATCH] xfs: shutdown filesystem if xfs_perag_get fails, Eric Sandeen|
|Indexes:||[Date] [Thread] [Top] [All Lists]|