ecryptfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tyler Hicks <tyhicks@canonical.com>
To: zhangzhilei <sdhzdmzzl@sina.com>
Cc: ecryptfs@vger.kernel.org
Subject: Re: how to retrun different size to different process when I use ecryptfs
Date: Fri, 29 Jan 2016 16:24:22 -0600	[thread overview]
Message-ID: <20160129222422.GB15683@boyd> (raw)
In-Reply-To: <loom.20160122T080227-125@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]

On 2016-01-22 07:28:11, zhangzhilei wrote:
> Hi
> 
>     a file named 1.txt ,and the content is 1234,when mounted ecryptfs, size
> is 4,after umounted ecryptfs, size is 12288.
>     I have  implemented a feature like this by modify ecryptfs source code:
>     1:when gedit read this file, return size is 4,and the content  is 1234;
>     2:when some other process read this file, the content is like what
> umounted read;
> 
>     when file is close, I use i_size_write to write back the size of file;
>     after gedit close the file ,use stat ,size is 4;
>     after any other process close the file,use stat ,size is 12288;
> 
>     what I want to ask is how can different size return when different
> process read size by stat。 
>      i.e:the file size is 100;when process a stats it, return size 1000,and
> when process stats it, return size 100;
>      but when I use stat, it appears that stat direct read cache ,not goes
> into ecryptfs's procedure;

This is either a bug or the process seeing the encrypted file size is
stat'ing the file in the lower mount point.

Can you please provide the (trimmed, if necessary) strace output of
these two processes as they stat(2) the file? Please use the -v option
of strace so that we can see the entire struct stat. Thanks!

Tyler

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-01-29 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  7:28 how to retrun different size to different process when I use ecryptfs zhangzhilei
2016-01-29 22:24 ` Tyler Hicks [this message]

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=20160129222422.GB15683@boyd \
    --to=tyhicks@canonical.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=sdhzdmzzl@sina.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).