xfs
[Top] [All Lists]

Re: [PATCH V2] xfstests: test EROFS vs. EEXIST when creating on an RO fi

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH V2] xfstests: test EROFS vs. EEXIST when creating on an RO filesystem
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 9 Jan 2013 08:31:00 +1100
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, Ben Myers <bpm@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <50EC8B98.1020004@xxxxxxxxxxx>
References: <50B52DB7.3030506@xxxxxxxxxx> <50B582B0.4050305@xxxxxxxxxxx> <20130108191509.GX27055@xxxxxxx> <50EC76B6.7040609@xxxxxxxxxxx> <20130108204859.GZ3120@dastard> <50EC8B98.1020004@xxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jan 08, 2013 at 03:11:52PM -0600, Eric Sandeen wrote:
> On 1/8/13 2:48 PM, Dave Chinner wrote:
> > On Tue, Jan 08, 2013 at 01:42:46PM -0600, Eric Sandeen wrote:
> >> On 1/8/13 1:15 PM, Ben Myers wrote:
> >>> Hey Eric,
> >>>
> >>> On Tue, Nov 27, 2012 at 09:19:12PM -0600, Eric Sandeen wrote:
> >>>> TBH, I don't know if this is posix-specified, but I found out the
> >>>> hard way that when trying to re-create existing files on a readonly 
> >>>> filesystem, some apps expect/handle EEXIST, but fail on EROFS.
> >>>>
> >>>> This will test mkdir, mknod, and symlinks for that behavior.
> >>>>
> >>>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> >>>> ---
> >>>>
> >>>> V2:  Change test dir var name, do scratch mkfs, drop _fail
> >>>
> >>> This looked fine to me except that...
> >>>
> >>>> diff --git a/292.out b/292.out
> >>>> new file mode 100644
> >>>> index 0000000..485c567
> >>>> --- /dev/null
> >>>> +++ b/292.out
> >>>> @@ -0,0 +1,5 @@
> >>>> +QA output created by 292
> >>>> +mknod: `SCRATCH_MNT/292.test/testnode': File exists
> >>>> +mkdir: cannot create directory `SCRATCH_MNT/292.test/testdir': File 
> >>>> exists
> >>>> +touch: cannot touch `SCRATCH_MNT/292.test/testtarget': Read-only file 
> >>>> system
> >>>> +ln: creating symbolic link `SCRATCH_MNT/292.test/testlink': File exists
> >>>
> >>> ln output is different on my distro:
> >>>
> >>> ~/xfstests # diff 293.out 293.out.bad
> >>> 5c5
> >>> < ln: creating symbolic link `SCRATCH_MNT/293.test/testlink': File exists
> >>> ---
> >>>> ln: failed to create symbolic link `SCRATCH_MNT/293.test/testlink': File 
> >>>> exists
> >>
> >> clearly using the wrong distro ;)
> >>
> >> How about something like:
> >>
> >> +_create_files 2>&1 | sed -e "s/failed to create/creating/" | 
> >> _filter_scratch
> >> +_scratch_mount -o remount,ro
> >> +_create_files 2>&1 | sed -e "s/failed to create/creating/" | 
> >> _filter_scratch
> > 
> > There should already be a ln filter that handles this.
> > 
> > Check test 103 - filter_ln.
> 
> yeah, it has:        -e "s,failed to create,creating,"
> so I guess it could be moved to common ...

*nod*

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>