Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736990
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Steve French <smfrench@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 02/10] cifs: honor AT_STATX_DONT_SYNC |
| Date | Thu, 21 Sep 2017 20:20:01 +0200 |
| Message-ID | <useeR-4od-3@gated-at.bofh.it> (permalink) |
| References | <urIRH-Bk-5@gated-at.bofh.it> <urIRI-Bk-23@gated-at.bofh.it> |
| X-Original-To | Miklos Szeredi <mszeredi@redhat.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jkLCoE7lFjwFbCHkqcB3Ei9VgJAbj80nXN2dMEia0+0=; b=kC5QvfEN81xKBpI0Mw6w8dV4I7XPWHY8DOfNejgLk0MPkA+YCOOmn0pmwwsCmMRodW mE4BmH/PBqg0OHaEwikfBqvd/xsffcSxKWA6k7ufsfM3wz2c2tDOo90qDGdaV2FvUgIB KqdVNcyfPLzq7OEXon1K9Wau8PkkuB7xTJCRrqQw9J1dhjqIJ2sR0zNGeEIPtId5SvpR CNLUIFtcSmKUNoAMb4x5gnPB9Nhcq2/65GVTXsM97FlFY7BN2doU+gShKP+vwb4sAcSB VK7eIRibZlvjIHmL0jiegkzEVfdpNBTSQ8wnKdeJwKXyCZkop/OVbEM5qXqCyN/OQQGJ NrQw== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jkLCoE7lFjwFbCHkqcB3Ei9VgJAbj80nXN2dMEia0+0=; b=cp/uchDBPdiaft85HV0R4YMMmF2oeN+kaofNI6U15LNttPzTGdDOq2xDa6tvO7AdRG q5rlvDMAjR9Pe/UiVUaP31sxKCCwd8jQw2WfXe7cE+1wRyRQA/oUxBKqsNkYkZDOH3lc C7ixtBsRDPV/bNPQuB4HIa6gZzSdRYBkQyu2atIF8zq/x68jBWr9/7mJNHzUSL7zc20O 7LqEvOPV5YOdJEbj4yxPb0n0RE0QP2bVXV8SL3rZuPb9MWqVvsDoe2W5h6eyNmQwgSBe mrLf41mzf9x72+fPe1e13pZkafxICB27mM8etgGGIl+8kDDUY3YWRAAa3I2s76Beyz5R 8VEA== |
| X-Gm-Message-State | AHPjjUhkYqFRfWnr04bkNgTuTc2wpNwOlirtChgOkGgZluRDT9RWzbOr L0A6puqTSwlga2tdTwZiXk7utv4Mt7KjH5DqQu4= |
| X-Google-SMTP-Source | AOwi7QDUXvPM8APpvpCLcEyZD7VLV2xhIv29utazWJxINH0F+a+LQCMX5Dq7wfeyciQ6HS5nPIuBaFUjy9MdilYwAk4= |
| X-Received | by 10.84.215.205 with SMTP id g13mr6331069plj.165.1506017667654; Thu, 21 Sep 2017 11:14:27 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 66 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-fsdevel <linux-fsdevel@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, Al Viro <viro@zeniv.linux.org.uk>, David Howells <dhowells@redhat.com>, Steve French <sfrench@samba.org> |
| X-Original-Date | Thu, 21 Sep 2017 13:14:07 -0500 |
| X-Original-Message-ID | <CAH2r5mtNGzVsoKw49zxButMNfwTtx1H4CFe9o9=mCxhCHZVFuw@mail.gmail.com> |
| X-Original-References | <1505896805-12055-1-git-send-email-mszeredi@redhat.com> <1505896805-12055-3-git-send-email-mszeredi@redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1736990 |
Show key headers only | View raw
Do you have any sample program/code to query with this flag?
On Wed, Sep 20, 2017 at 3:39 AM, Miklos Szeredi <mszeredi@redhat.com> wrote:
> The description of this flag says "Don't sync attributes with the server".
> In other words: always use the attributes cached in the kernel and don't
> send network or local messages to refresh the attributes.
>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Cc: Steve French <sfrench@samba.org>
> ---
> fs/cifs/inode.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index a8693632235f..982ba2e4f549 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -2003,22 +2003,24 @@ int cifs_getattr(const struct path *path, struct kstat *stat,
> struct inode *inode = d_inode(dentry);
> int rc;
>
> - /*
> - * We need to be sure that all dirty pages are written and the server
> - * has actual ctime, mtime and file length.
> - */
> - if (!CIFS_CACHE_READ(CIFS_I(inode)) && inode->i_mapping &&
> - inode->i_mapping->nrpages != 0) {
> - rc = filemap_fdatawait(inode->i_mapping);
> - if (rc) {
> - mapping_set_error(inode->i_mapping, rc);
> - return rc;
> + if (!(flags & AT_STATX_DONT_SYNC)) {
> + /*
> + * We need to be sure that all dirty pages are written and the
> + * server has actual ctime, mtime and file length.
> + */
> + if (!CIFS_CACHE_READ(CIFS_I(inode)) && inode->i_mapping &&
> + inode->i_mapping->nrpages != 0) {
> + rc = filemap_fdatawait(inode->i_mapping);
> + if (rc) {
> + mapping_set_error(inode->i_mapping, rc);
> + return rc;
> + }
> }
> - }
>
> - rc = cifs_revalidate_dentry_attr(dentry);
> - if (rc)
> - return rc;
> + rc = cifs_revalidate_dentry_attr(dentry);
> + if (rc)
> + return rc;
> + }
>
> generic_fillattr(inode, stat);
> stat->blksize = CIFS_MAX_MSGSIZE;
> --
> 2.5.5
>
--
Thanks,
Steve
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 02/10] cifs: honor AT_STATX_DONT_SYNC Miklos Szeredi <mszeredi@redhat.com> - 2017-09-20 10:50 +0200 Re: [PATCH 02/10] cifs: honor AT_STATX_DONT_SYNC Steve French <smfrench@gmail.com> - 2017-09-21 20:20 +0200
csiph-web