Files
i2som-imx-linux/fs
David Woodhouse b723bb7c4f Fix directory hardlinks from deleted directories
commit be629c62a6 upstream.

When a directory is deleted, we don't take too much care about killing off
all the dirents that belong to it — on the basis that on remount, the scan
will conclude that the directory is dead anyway.

This doesn't work though, when the deleted directory contained a child
directory which was moved *out*. In the early stages of the fs build
we can then end up with an apparent hard link, with the child directory
appearing both in its true location, and as a child of the original
directory which are this stage of the mount process we don't *yet* know
is defunct.

To resolve this, take out the early special-casing of the "directories
shall not have hard links" rule in jffs2_build_inode_pass1(), and let the
normal nlink processing happen for directories as well as other inodes.

Then later in the build process we can set ic->pino_nlink to the parent
inode#, as is required for directories during normal operaton, instead
of the nlink. And complain only *then* about hard links which are still
in evidence even after killing off all the unreachable paths.

Reported-by: Liu Song <liu.song11@zte.com.cn>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-09 15:31:54 -08:00
..
2013-05-07 20:16:25 -07:00
2016-02-25 11:57:46 -08:00
2013-03-12 18:55:21 -07:00
2016-03-03 15:06:23 -08:00
2013-04-29 15:41:42 -04:00
2015-04-29 10:33:57 +02:00
2013-03-23 14:15:31 -07:00
2013-05-07 20:16:25 -07:00
2016-02-19 14:22:39 -08:00
2016-02-25 11:57:46 -08:00
2013-04-29 15:40:23 -04:00
2013-10-05 07:13:09 -07:00
2013-05-07 20:16:25 -07:00
2013-02-22 23:31:31 -05:00
2015-07-03 19:48:08 -07:00
2015-07-10 10:40:22 -07:00
2015-07-03 19:48:08 -07:00
2013-02-22 23:31:31 -05:00
2013-04-17 13:25:09 +01:00
2015-07-03 19:48:08 -07:00
2013-05-31 15:16:33 -04:00
2013-02-22 23:31:31 -05:00
2015-07-03 19:48:08 -07:00