linux/fs/hpfs
Mikulas Patocka 44d51706b4 hpfs: fix remount failure when there are no options changed
Commit ce657611ba ("hpfs: kstrdup() out of memory handling") checks if
the kstrdup function returns NULL due to out-of-memory condition.

However, if we are remounting a filesystem with no change to
filesystem-specific options, the parameter data is NULL.  In this case,
kstrdup returns NULL (because it was passed NULL parameter), although no
out of memory condition exists.  The mount syscall then fails with
ENOMEM.

This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.

The patch also changes the call to replace_mount_options - if we didn't
pass any filesystem-specific options, we don't call
replace_mount_options (thus we don't erase existing reported options).

Fixes: ce657611ba ("hpfs: kstrdup() out of memory handling")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
..
alloc.c hpfs: add fstrim support 2015-07-09 13:35:30 -07:00
anode.c hpfs: convert to use leXX_add_cpu() 2012-10-06 03:05:08 +09:00
buffer.c hpfs: support hotfixes 2015-09-03 11:55:30 -07:00
dentry.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
dir.c hpfs: switch to ->iterate_shared() 2016-05-12 19:47:13 -04:00
dnode.c hpfs: handle allocation failures in hpfs_add_pos() 2016-05-12 19:35:57 -04:00
ea.c fs/hpfs: increase pr_warn level 2014-06-06 16:08:10 -07:00
file.c hpfs: support hotfixes 2015-09-03 11:55:30 -07:00
hpfs_fn.h hpfs: handle allocation failures in hpfs_add_pos() 2016-05-12 19:35:57 -04:00
hpfs.h hpfs: assorted endianness annotations 2012-05-29 23:28:39 -04:00
inode.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05:00
Kconfig HPFS: Make HPFS compile on preempt and SMP 2011-05-09 09:04:23 -07:00
Makefile
map.c hpfs: missing endianness annotation 2016-01-04 10:29:03 -05:00
name.c fs/hpfs: increase pr_warn level 2014-06-06 16:08:10 -07:00
namei.c hpfs: don't truncate the file when delete fails 2016-02-27 19:15:51 -05:00
super.c hpfs: fix remount failure when there are no options changed 2016-05-28 16:50:24 -07:00