aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/debug.c2
-rw-r--r--fs/ubifs/file.c13
-rw-r--r--fs/ubifs/super.c20
3 files changed, 17 insertions, 18 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index dbc093afd946..8a771c59ac3e 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2014,7 +2014,7 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
2014 inum = key_inum_flash(c, &dent->key); 2014 inum = key_inum_flash(c, &dent->key);
2015 fscki1 = read_add_inode(c, priv, inum); 2015 fscki1 = read_add_inode(c, priv, inum);
2016 if (IS_ERR(fscki1)) { 2016 if (IS_ERR(fscki1)) {
2017 err = PTR_ERR(fscki); 2017 err = PTR_ERR(fscki1);
2018 ubifs_err("error %d while processing entry node and " 2018 ubifs_err("error %d while processing entry node and "
2019 "trying to find parent inode node %lu", 2019 "trying to find parent inode node %lu",
2020 err, (unsigned long)inum); 2020 err, (unsigned long)inum);
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 1009adc8d602..39849f887e72 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1389,7 +1389,6 @@ static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov,
1389 unsigned long nr_segs, loff_t pos) 1389 unsigned long nr_segs, loff_t pos)
1390{ 1390{
1391 int err; 1391 int err;
1392 ssize_t ret;
1393 struct inode *inode = iocb->ki_filp->f_mapping->host; 1392 struct inode *inode = iocb->ki_filp->f_mapping->host;
1394 struct ubifs_info *c = inode->i_sb->s_fs_info; 1393 struct ubifs_info *c = inode->i_sb->s_fs_info;
1395 1394
@@ -1397,17 +1396,7 @@ static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov,
1397 if (err) 1396 if (err)
1398 return err; 1397 return err;
1399 1398
1400 ret = generic_file_aio_write(iocb, iov, nr_segs, pos); 1399 return generic_file_aio_write(iocb, iov, nr_segs, pos);
1401 if (ret < 0)
1402 return ret;
1403
1404 if (ret > 0 && (IS_SYNC(inode) || iocb->ki_filp->f_flags & O_SYNC)) {
1405 err = ubifs_sync_wbufs_by_inode(c, inode);
1406 if (err)
1407 return err;
1408 }
1409
1410 return ret;
1411} 1400}
1412 1401
1413static int ubifs_set_page_dirty(struct page *page) 1402static int ubifs_set_page_dirty(struct page *page)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 333e181ee987..943ad5624530 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1842,22 +1842,32 @@ const struct super_operations ubifs_super_operations = {
1842 * @name: UBI volume name 1842 * @name: UBI volume name
1843 * @mode: UBI volume open mode 1843 * @mode: UBI volume open mode
1844 * 1844 *
1845 * There are several ways to specify UBI volumes when mounting UBIFS: 1845 * The primary method of mounting UBIFS is by specifying the UBI volume
1846 * o ubiX_Y - UBI device number X, volume Y; 1846 * character device node path. However, UBIFS may also be mounted withoug any
1847 * o ubiY - UBI device number 0, volume Y; 1847 * character device node using one of the following methods:
1848 *
1849 * o ubiX_Y - mount UBI device number X, volume Y;
1850 * o ubiY - mount UBI device number 0, volume Y;
1848 * o ubiX:NAME - mount UBI device X, volume with name NAME; 1851 * o ubiX:NAME - mount UBI device X, volume with name NAME;
1849 * o ubi:NAME - mount UBI device 0, volume with name NAME. 1852 * o ubi:NAME - mount UBI device 0, volume with name NAME.
1850 * 1853 *
1851 * Alternative '!' separator may be used instead of ':' (because some shells 1854 * Alternative '!' separator may be used instead of ':' (because some shells
1852 * like busybox may interpret ':' as an NFS host name separator). This function 1855 * like busybox may interpret ':' as an NFS host name separator). This function
1853 * returns ubi volume object in case of success and a negative error code in 1856 * returns UBI volume description object in case of success and a negative
1854 * case of failure. 1857 * error code in case of failure.
1855 */ 1858 */
1856static struct ubi_volume_desc *open_ubi(const char *name, int mode) 1859static struct ubi_volume_desc *open_ubi(const char *name, int mode)
1857{ 1860{
1861 struct ubi_volume_desc *ubi;
1858 int dev, vol; 1862 int dev, vol;
1859 char *endptr; 1863 char *endptr;
1860 1864
1865 /* First, try to open using the device node path method */
1866 ubi = ubi_open_volume_path(name, mode);
1867 if (!IS_ERR(ubi))
1868 return ubi;
1869
1870 /* Try the "nodev" method */
1861 if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') 1871 if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i')
1862 return ERR_PTR(-EINVAL); 1872 return ERR_PTR(-EINVAL);
1863 1873