All of lore.kernel.org
 help / color / mirror / Atom feed
* AW: Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular  file using O_TMPFILE") breaks ubifs
@ 2017-03-30  6:56 Richard Weinberger
  2017-03-30  7:28 ` Ralph Sennhauser
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2017-03-30  6:56 UTC (permalink / raw)
  To: Ralph Sennhauser
  Cc: Amir Goldstein, Miklos Szeredi, linux-unionfs, linux-kernel,
	linux-mtd, regressions, Artem Bityutskiy, Adrian Hunter,
	David Oberhollenzer

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


    
Ralph,
Please apply this fix:http://lists.infradead.org/pipermail/linux-mtd/2017-March/072613.html


Von meinem Samsung Gerät gesendet.

-------- Ursprüngliche Nachricht --------
Von: Ralph Sennhauser <ralph.sennhauser@gmail.com> 
Datum: 30.03.17  07:53  (GMT+01:00) 
An: Richard Weinberger <richard@nod.at> 
Cc: Amir Goldstein <amir73il@gmail.com>, Miklos Szeredi <miklos@szeredi.hu>, linux-unionfs@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>, linux-mtd@lists.infradead.org, regressions@leemhuis.info, Artem Bityutskiy <dedekind1@gmail.com>, Adrian Hunter <adrian.hunter@intel.com>, David Oberhollenzer <goliath@sigma-star.at> 
Betreff: Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular\r&nbsp; file using O_TMPFILE") breaks ubifs 

Hi Richard,

On Thu, 30 Mar 2017 00:15:31 +0200
Richard Weinberger <richard@nod.at> wrote:

> Ralph,
> 
> Am 29.03.2017 um 23:26 schrieb Ralph Sennhauser:
> >> # create and link a tmpfile - then remove it
> >> sudo rm -rf foo; sudo xfs_io -T -c "flink foo" . ; ls -l foo; sudo
> >> rm foo  
> > 
> > next-20170328, obviously without your patch:
> > 
> >   # xfs_io -T -c "flink foo" .
> >   .: Not supported  
> 
> -T tells xfs_io to create a tmpfile but you have it disabled in UBIFS.

Bash history says I booted the other partition than I flashed (uname
just happened to match), the downside of the dual boot layout. :)

  # rm -rf foo
  # xfs_io -T -c "flink foo" .
  # ls -l foo
  -rw-------    1 root     root             0 Mar 30 02:00 foo
  # rm foo
  [  305.001436] UBIFS error (ubi0:0 pid 2493): ubifs_add_orphan: orphaned twice

However, unlike with the overlay setup the filesystem can be mounted
just fine without imediatly visible side effects.

> 
> Anyway, can you please test the attached patch?
> Amir was right, UBIFS misses a corner case in ubifs_link(). ;-\
> 
> I think I understand also why we never noticed this in xfstests,
> UBIFS prints only a non-fatal error while umounting the filesystem in
> this case. But will test tomorrow in more detail, need some sleep now.
> 
> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> index 30825d882aa9..95e348a2da29 100644
> --- a/fs/ubifs/dir.c
> +++ b/fs/ubifs/dir.c
> @@ -748,6 +748,9 @@ static int ubifs_link(struct dentry *old_dentry,
> struct inode *dir, goto out_fname;
> 
>  	lock_2_inodes(dir, inode);
> +	if (inode->i_nlink == 0)
> +		ubifs_delete_orphan(c, inode->i_ino);
> +
>  	inc_nlink(inode);
>  	ihold(inode);
>  	inode->i_ctime = ubifs_current_time(inode);
> 
> Thanks,
> //richard

With this patch I'm no longer able to reproduce _this_ issue, however,
rename no longer works either:

  # mv /etc/config/wireless /etc/config/wireless.back
  mv: can't rename '/etc/config/wireless': Invalid argument
  # ls /etc/config/wireless
  /etc/config/wireless
  # rm /etc/config/wireless
  # ls /etc/config/wireless
  ls: /etc/config/wireless: No such file or directory


Thanks
Ralph

[-- Attachment #2: Type: text/html, Size: 3885 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular file using O_TMPFILE") breaks ubifs
  2017-03-30  6:56 AW: Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular file using O_TMPFILE") breaks ubifs Richard Weinberger
@ 2017-03-30  7:28 ` Ralph Sennhauser
  0 siblings, 0 replies; 2+ messages in thread
From: Ralph Sennhauser @ 2017-03-30  7:28 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Amir Goldstein, Miklos Szeredi, linux-unionfs, linux-kernel,
	linux-mtd, regressions, Artem Bityutskiy, Adrian Hunter,
	David Oberhollenzer

Hi Richard,

On Thu, 30 Mar 2017 08:56:57 +0200
Richard Weinberger <richard@nod.at> wrote:

>     
> Ralph,
> Please apply this
> fix:http://lists.infradead.org/pipermail/linux-mtd/2017-March/072613.html
> 

No longer able to observe an issue with this one on top. The two
patches seem all that was needed to get things back to a working state.

Do you want me to test anything else than linux-next?

Thanks
Ralph

> 
> Von meinem Samsung Gerät gesendet.
> 
> -------- Ursprüngliche Nachricht --------
> Von: Ralph Sennhauser <ralph.sennhauser@gmail.com> 
> Datum: 30.03.17  07:53  (GMT+01:00) 
> An: Richard Weinberger <richard@nod.at> 
> Cc: Amir Goldstein <amir73il@gmail.com>, Miklos Szeredi
> <miklos@szeredi.hu>, linux-unionfs@vger.kernel.org, linux-kernel
> <linux-kernel@vger.kernel.org>, linux-mtd@lists.infradead.org,
> regressions@leemhuis.info, Artem Bityutskiy <dedekind1@gmail.com>,
> Adrian Hunter <adrian.hunter@intel.com>, David Oberhollenzer
> <goliath@sigma-star.at> Betreff: Re: [REGRESSION 4.11] Commit
> d8514d8edb5b ("ovl: copy up regular\r&nbsp; file using O_TMPFILE") breaks ubifs 
> 
> Hi Richard,
> 
> On Thu, 30 Mar 2017 00:15:31 +0200
> Richard Weinberger <richard@nod.at> wrote:
> 
> > Ralph,
> > 
> > Am 29.03.2017 um 23:26 schrieb Ralph Sennhauser:  
> > >> # create and link a tmpfile - then remove it
> > >> sudo rm -rf foo; sudo xfs_io -T -c "flink foo" . ; ls -l foo;
> > >> sudo rm foo    
> > > 
> > > next-20170328, obviously without your patch:
> > > 
> > >   # xfs_io -T -c "flink foo" .
> > >   .: Not supported    
> > 
> > -T tells xfs_io to create a tmpfile but you have it disabled in
> > UBIFS.  
> 
> Bash history says I booted the other partition than I flashed (uname
> just happened to match), the downside of the dual boot layout. :)
> 
>   # rm -rf foo
>   # xfs_io -T -c "flink foo" .
>   # ls -l foo
>   -rw-------    1 root     root             0 Mar 30 02:00 foo
>   # rm foo
>   [  305.001436] UBIFS error (ubi0:0 pid 2493): ubifs_add_orphan:
> orphaned twice
> 
> However, unlike with the overlay setup the filesystem can be mounted
> just fine without imediatly visible side effects.
> 
> > 
> > Anyway, can you please test the attached patch?
> > Amir was right, UBIFS misses a corner case in ubifs_link(). ;-\
> > 
> > I think I understand also why we never noticed this in xfstests,
> > UBIFS prints only a non-fatal error while umounting the filesystem
> > in this case. But will test tomorrow in more detail, need some
> > sleep now.
> > 
> > diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> > index 30825d882aa9..95e348a2da29 100644
> > --- a/fs/ubifs/dir.c
> > +++ b/fs/ubifs/dir.c
> > @@ -748,6 +748,9 @@ static int ubifs_link(struct dentry *old_dentry,
> > struct inode *dir, goto out_fname;
> > 
> >  	lock_2_inodes(dir, inode);
> > +	if (inode->i_nlink == 0)
> > +		ubifs_delete_orphan(c, inode->i_ino);
> > +
> >  	inc_nlink(inode);
> >  	ihold(inode);
> >  	inode->i_ctime = ubifs_current_time(inode);
> > 
> > Thanks,
> > //richard  
> 
> With this patch I'm no longer able to reproduce _this_ issue, however,
> rename no longer works either:
> 
>   # mv /etc/config/wireless /etc/config/wireless.back
>   mv: can't rename '/etc/config/wireless': Invalid argument
>   # ls /etc/config/wireless
>   /etc/config/wireless
>   # rm /etc/config/wireless
>   # ls /etc/config/wireless
>   ls: /etc/config/wireless: No such file or directory
> 
> 
> Thanks
> Ralph

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-30  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30  6:56 AW: Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular file using O_TMPFILE") breaks ubifs Richard Weinberger
2017-03-30  7:28 ` Ralph Sennhauser

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.