Re: [PATCH v2 1/2] iomap: provide more useful errors for invalid swap files

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

 



On Wed, May 16, 2018 at 10:32:51AM -0700, Omar Sandoval wrote:
> On Wed, May 16, 2018 at 10:25:31AM -0700, Christoph Hellwig wrote:
> > On Wed, May 16, 2018 at 09:45:50AM -0700, Omar Sandoval wrote:
> > > +	if ((iomap->type != IOMAP_MAPPED && iomap->type != IOMAP_UNWRITTEN) ||
> > > +	    iomap->addr == IOMAP_NULL_ADDR) {
> > > +		pr_err("swapon: file has unallocated extents\n");
> > > +		return -EINVAL;
> > > +	}
> > 
> > The two are really different cases - IOMAP_NULL_ADDR shouldn't really
> > happen for any of the above.  Although we might have to move the
> > inline check before the type check above for the message to make sense.
> > 
> > I have a patch in the local queue that makes inline a type instead of
> > a flag, btw as it really isn't a flag.
> 
> So something like this, moving the inline check and removing the hole
> check since that doesn't make sense for mapped or unwritten? Then the
> inline flag check can be converted to a type check.

Yes, this looks great!



[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