From: Kinglong Mee <kinglongmee@gmail.com>
To: Christoph Hellwig <hch@infradead.org>,
"J. Bruce Fields" <bfields@fieldses.org>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
kinglongmee@gmail.com
Subject: Re: [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit
Date: Thu, 09 Jul 2015 17:28:42 +0800 [thread overview]
Message-ID: <559E3ECA.6000606@gmail.com> (raw)
In-Reply-To: <20150709080419.GA19291@infradead.org>
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
next prev parent reply other threads:[~2015-07-09 9:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 2:12 [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit Kinglong Mee
2015-07-07 2:13 ` [PATCH 2/3] nfsd: Fix a memory leak in nfsd4_list_rec_dir() Kinglong Mee
2015-07-08 20:43 ` J. Bruce Fields
2015-07-07 2:16 ` [PATCH 3/3] nfsd: Drop BUG_ON and don't reply SECLABEL when exports migrated Kinglong Mee
2015-07-08 20:44 ` J. Bruce Fields
2015-07-08 18:44 ` [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit J. Bruce Fields
2015-07-09 8:04 ` Christoph Hellwig
2015-07-09 9:28 ` Kinglong Mee [this message]
2015-07-09 13:52 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559E3ECA.6000606@gmail.com \
--to=kinglongmee@gmail.com \
--cc=bfields@fieldses.org \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.