mirror of https://gitee.com/openkylin/linux.git
This pull request contains fixes for a regression introduced in rc1.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJXYbt+AAoJEEtJtSqsAOnWjM8P/iWGc7Mq60uWKFA17K9i73ZD 5xFcrTxnV/zXOfYaNGwF72KQp6qbGl7fqt4IA9bEATA+v0y7SJg0+tSpSFeYz/uB gViEBtHCiX3uNn9HkWtP2zRddElJmyTsX+o8QWBgXEzIy03sWCgWjMeXEuFWQCep QOKHhNgZPw/Rfz9EJMc+8+vNOeK2ic4KkJ0GTKoDLUV6uPES5E6vE/N6mX4X92Js ROht6cSTygT7Pu635BX6Vji8gFCln5yNiHxhJhqwRokgjCaphznZNV9SfSQ7sLMB QBD4p88OGWuuwudsjF7aQ5P25wvAshM+h/TtYY8SAyf9GEVPG8hDWAEgm7ovwgOx gVIRqjCYN8MgCzo5ywYwaa1h5KKH4fb/BmBFYgWOaIoKqxYr8hpaU1pBcATbknm7 +lcpBaJvxVG5Uryecztu1pnMzgY+BvLiVCFedgv8RMrZS/YMZ01901J3wqqCt+gf mGrJDJGhWDyTH5/MtyVjoYha3RopYcLEKXTISynGZeUg2pkI2my4RBboAqEeOx1q 6jtFH3MdfQPXDOfyIpi4uRrExbBWvGg416+sPZkyBXMw+3VRVc+jzfwlhe1LuiDJ xJRsC46cLTtZJiv9PKKb51fE7mQ5MeTthKjKqCFljaM8T8HWRnyv0FZAJZYy/XvP /Wj1XA0f77Ni+6giiKle =yLxu -----END PGP SIGNATURE----- Merge tag 'upstream-4.7-rc4' of git://git.infradead.org/linux-ubifs Pull UBI fixes from Richard Weinberger: "This contains fixes for a regression introduced in rc1" * tag 'upstream-4.7-rc4' of git://git.infradead.org/linux-ubifs: ubi: Don't bypass ->getattr() Revert "mtd: switch open_mtd_by_chdev() to use of vfs_stat()" Revert "mtd: switch ubi_open_volume_path() to vfs_stat()"
This commit is contained in:
commit
abd3830163
|
@ -1147,11 +1147,17 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
|
|||
*/
|
||||
static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
|
||||
{
|
||||
struct kstat stat;
|
||||
int err, minor;
|
||||
struct path path;
|
||||
struct kstat stat;
|
||||
|
||||
/* Probably this is an MTD character device node path */
|
||||
err = vfs_stat(mtd_dev, &stat);
|
||||
err = kern_path(mtd_dev, LOOKUP_FOLLOW, &path);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
|
||||
err = vfs_getattr(&path, &stat);
|
||||
path_put(&path);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
|
||||
|
@ -1160,6 +1166,7 @@ static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
|
|||
return ERR_PTR(-EINVAL);
|
||||
|
||||
minor = MINOR(stat.rdev);
|
||||
|
||||
if (minor & 1)
|
||||
/*
|
||||
* Just do not think the "/dev/mtdrX" devices support is need,
|
||||
|
|
|
@ -302,6 +302,7 @@ EXPORT_SYMBOL_GPL(ubi_open_volume_nm);
|
|||
struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
|
||||
{
|
||||
int error, ubi_num, vol_id;
|
||||
struct path path;
|
||||
struct kstat stat;
|
||||
|
||||
dbg_gen("open volume %s, mode %d", pathname, mode);
|
||||
|
@ -309,7 +310,12 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
|
|||
if (!pathname || !*pathname)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
error = vfs_stat(pathname, &stat);
|
||||
error = kern_path(pathname, LOOKUP_FOLLOW, &path);
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
||||
error = vfs_getattr(&path, &stat);
|
||||
path_put(&path);
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
||||
|
|
Loading…
Reference in New Issue