linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Chandan Rajendra <chandan@linux.vnet.ibm.com>,
	fstests <fstests@vger.kernel.org>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] src/t_dir_type.c: Use strtoul() instead of atoll()
Date: Tue, 14 Nov 2017 19:50:21 +0800	[thread overview]
Message-ID: <20171114115021.GI17339@eguan.usersys.redhat.com> (raw)
In-Reply-To: <CAOQ4uxjBihgjimmv6KNugYM=O=BPn+JAJEDGfU-NJb6uZR7uvw@mail.gmail.com>

On Tue, Nov 14, 2017 at 01:23:18PM +0200, Amir Goldstein wrote:
> On Tue, Nov 14, 2017 at 1:13 PM, Eryu Guan <eguan@redhat.com> wrote:
> > On Mon, Nov 13, 2017 at 04:57:08PM +0200, Amir Goldstein wrote:
> >> On Mon, Nov 13, 2017 at 4:45 PM, Chandan Rajendra
> >> <chandan@linux.vnet.ibm.com> wrote:
> >> > An overlayfs filesystem instance with one lowerdir filesystem and with
> >> > "xino" mount option enabled can have the layer index encoded in the 63rd
> >> > bit of the inode number. A signed 64 bit integer won't suffice to store
> >> > this inode number. Hence this commit uses strtoul() to convert the inode
> >> > number in string form to unsigned integer form.
> >> >
> >> > Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
> >>
> >> Looks good, especially since I had to fix the same problem myself ;)
> >> https://github.com/amir73il/xfstests/commits/overlayfs-devel
> >>
> >> My patch also changes:
> >>
> >>         int type = -1; /* -1 means all types */
> >> -       uint64_t ino = 0;
> >> +       unsigned long ino = 0;
> >>         int ret = 1;
> >>
> >> But I am not sure that is the right thing to do here or what difference it makes
> >
> > I think that strtoul() returns unsigned long, which could be 32bit, and
> > uint64_t is guaranteed to be 64bit size, so I tend to change the ino
> > definition too. But I guess that doesn't matter that much :)
> >
> 
> The thing is that 'ino' is later compared with 'd->d_ino', which is uint64_t,
> so on 32bit CPU, the conversion will happen either in assignment from
> strtoul() or in comparison later. I guess it doesn't matter much, so I prefer
> Chandan's version that leaves ino as uint64_t.

Yeah, I noticed that too. I'll take it as-is, thanks!

Eryu

      reply	other threads:[~2017-11-14 11:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 14:45 [PATCH 1/2] src/t_dir_type.c: Use strtoul() instead of atoll() Chandan Rajendra
2017-11-13 14:45 ` [PATCH 2/2] overlay: Test consistent st_ino numbers for non-samefs scenario Chandan Rajendra
2017-11-13 15:08   ` Amir Goldstein
2017-11-13 17:47   ` Amir Goldstein
2017-11-13 14:57 ` [PATCH 1/2] src/t_dir_type.c: Use strtoul() instead of atoll() Amir Goldstein
2017-11-14 11:13   ` Eryu Guan
2017-11-14 11:23     ` Amir Goldstein
2017-11-14 11:50       ` Eryu Guan [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=20171114115021.GI17339@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=chandan@linux.vnet.ibm.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@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 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 NNTP newsgroup(s).