Re: [PATCH v2 4/4] splice: fix updating sd->pos wrongly

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

 



On Sat, May 29, 2010 at 10:09 PM, Jamie Lokier <jamie@xxxxxxxxxxxxx> wrote:
>
> Not true if the "file" is /dev/mem or /dev/kmem.  The starting offset
> can be negative, so can end at zero.
>
> It's an obscure case and I don't know if you can sendfile from
> /dev/{,k}mem anyway :-) but illustrates why sd->pos != 0 is dubious.
>

So the safe way is checking if splice_read() updates pos or not, isn't it?

if (sd->pos != prev_pos)
    sd->pos = prev_pos + ret;


-- 
Regards,
Changli Gao(xiaosuo@xxxxxxxxx)
--
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