Re: [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit

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

 



On 7/9/2015 16:04, Christoph Hellwig wrote:
> On Wed, Jul 08, 2015 at 02:44:31PM -0400, J. Bruce Fields wrote:
>> On Tue, Jul 07, 2015 at 10:12:03AM +0800, Kinglong Mee wrote:
>>> After proc_layoutcommit success, i_size_read(inode) always >= new_size.
>>> Just set lc_size_chg before proc_layoutcommit, if proc_layoutcommit
>>> failed, nfsd will skip the lc_size_chg, so it's no harm.
>>
>> Looks right to me, though could probably use an ACK from Christoph.
>>
>> (But looking at the spec I'm confused about how the client is supposed
>> to use this information.)
> 
> I don;t think its possible to use, as there it is inherently racy.
> 
> If the test passes xfstests I'm fine with it.

nfs client just drop this value directly in decode_layoutcommit(),

        if (sizechanged) {
                /* throw away new size */
                p = xdr_inline_decode(xdr, 8);
                if (unlikely(!p))
                        goto out_overflow;
        }

The only problem is after ops->proc_layoutcommit(),  new_size will never
larger than inode's size, at most it is equal to.

        if (new_size > i_size_read(inode)) {
                lcp->lc_size_chg = 1;
                lcp->lc_newsize = new_size;
        } else {
                lcp->lc_size_chg = 0;
        }

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



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux