On 11/08/2010 05:58 PM, Jeff Layton wrote:
> Commit 13cfb7334e made cifs_ioctl use the tlink attached to the
> cifsFileInfo for a filp. This ignores the case of an open directory
> however, which in CIFS can have a NULL private_data until a readdir
> is done on it.
> 
> This patch re-adds the NULL pointer checks that were removed in commit
> 50ae28f01 and moves the setting of tcon and "caps" variables lower.
> 
> Long term, a better fix would be to establish a f_op->open routine for
> directories that populates that field at open time, but that requires
> some other changes to how readdir calls are handled.
> 
> Reported-by: Kjell Rune Skaaraas <[email protected]>
> Signed-off-by: Jeff Layton <[email protected]>
> ---
>  fs/cifs/ioctl.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 

Looks correct to me and fixes the bug caused by my reproducer.
(BTW, the file should be open with O_RDONLY in the reproducer to trigger
the Oops)


Reviewed-and-Tested-by: Suresh Jayaraman <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to