Re: [patch 8/8] consolidate generic_writepages and mpage_writepages fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > From: Miklos Szeredi <mszeredi@xxxxxxx>
> > 
> > Fix NULL pointer dereference in __mpage_writepage.  This probably
> > doesn't matter in practice, but this is the original behavior.
> > 
> > Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
> > ---
> > 
> > Index: linux/fs/mpage.c
> > ===================================================================
> > --- linux.orig/fs/mpage.c	2007-03-06 17:30:09.000000000 +0100
> > +++ linux/fs/mpage.c	2007-03-06 17:30:33.000000000 +0100
> > @@ -662,7 +662,7 @@ confused:
> >  	if (bio)
> >  		bio = mpage_bio_submit(WRITE, bio);
> >  
> > -	if (mpd->use_writepage) {
> > +	if (mpd->use_writepage && mapping->a_ops->writepage) {
> >  		ret = mapping->a_ops->writepage(page, wbc);
> >  	} else {
> >  		ret = -EAGAIN;
> > 
> > --
> 
> I'm inclined to leave the code as-is, as an optimisation.  If it
> blows up then it'd be cleaner to change the caller (mpage_writepages)
> to do
> 
> 	.use_writepage = (writepage != NULL),
> 
> ?

It seems all in-tree uses of mpage_writepages define ->writepage() so
it should be safe to drop this patch.

Thanks,
Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux