Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec0ad730 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ext3, reiserfs, udf & isofs fixes from Jan Kara:
 "The contains a bunch of ext3 cleanups and minor improvements, major
  reiserfs locking changes which should hopefully fix deadlocks
  introduced by BKL removal, and udf/isofs changes to refuse mounting fs
  rw instead of mounting it ro automatically which makes eject button
  work as expected for all media (see the changelog for why userspace
  should be ok with this change)"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  jbd: use a single printk for jbd_debug()
  reiserfs: locking, release lock around quota operations
  reiserfs: locking, handle nested locks properly
  reiserfs: locking, push write lock out of xattr code
  jbd: relocate assert after state lock in journal_commit_transaction()
  udf: Refuse RW mount of the filesystem instead of making it RO
  udf: Standardize return values in mount sequence
  isofs: Refuse RW mount of the filesystem instead of making it RO
  ext3: allow specifying external journal by pathname mount option
  jbd: remove unneeded semicolon
parents eb97a784 97a2847d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -26,11 +26,12 @@ journal=inum When a journal already exists, this option is ignored.
			Otherwise, it specifies the number of the inode which
			will represent the ext3 file system's journal file.

journal_path=path
journal_dev=devnum	When the external journal device's major/minor numbers
			have changed, this option allows the user to specify
			have changed, these options allow the user to specify
			the new journal location.  The journal device is
			identified through its new major/minor numbers encoded
			in devnum.
			identified through either its new major/minor numbers
			encoded in devnum, or via a path to the device.

norecovery		Don't load the journal on mounting. Note that this forces
noload			mount of inconsistent filesystem, which can lead to
+43 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/seq_file.h>
#include <linux/log2.h>
#include <linux/cleancache.h>
#include <linux/namei.h>

#include <asm/uaccess.h>

@@ -819,6 +820,7 @@ enum {
	Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl,
	Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh, Opt_bh,
	Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_journal_dev,
	Opt_journal_path,
	Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
	Opt_data_err_abort, Opt_data_err_ignore,
	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
@@ -860,6 +862,7 @@ static const match_table_t tokens = {
	{Opt_journal_update, "journal=update"},
	{Opt_journal_inum, "journal=%u"},
	{Opt_journal_dev, "journal_dev=%u"},
	{Opt_journal_path, "journal_path=%s"},
	{Opt_abort, "abort"},
	{Opt_data_journal, "data=journal"},
	{Opt_data_ordered, "data=ordered"},
@@ -975,6 +978,11 @@ static int parse_options (char *options, struct super_block *sb,
	int option;
	kuid_t uid;
	kgid_t gid;
	char *journal_path;
	struct inode *journal_inode;
	struct path path;
	int error;

#ifdef CONFIG_QUOTA
	int qfmt;
#endif
@@ -1129,6 +1137,41 @@ static int parse_options (char *options, struct super_block *sb,
				return 0;
			*journal_devnum = option;
			break;
		case Opt_journal_path:
			if (is_remount) {
				ext3_msg(sb, KERN_ERR, "error: cannot specify "
				       "journal on remount");
				return 0;
			}

			journal_path = match_strdup(&args[0]);
			if (!journal_path) {
				ext3_msg(sb, KERN_ERR, "error: could not dup "
					"journal device string");
				return 0;
			}

			error = kern_path(journal_path, LOOKUP_FOLLOW, &path);
			if (error) {
				ext3_msg(sb, KERN_ERR, "error: could not find "
					"journal device path: error %d", error);
				kfree(journal_path);
				return 0;
			}

			journal_inode = path.dentry->d_inode;
			if (!S_ISBLK(journal_inode->i_mode)) {
				ext3_msg(sb, KERN_ERR, "error: journal path %s "
					"is not a block device", journal_path);
				path_put(&path);
				kfree(journal_path);
				return 0;
			}

			*journal_devnum = new_encode_dev(journal_inode->i_rdev);
			path_put(&path);
			kfree(journal_path);
			break;
		case Opt_noload:
			set_opt (sbi->s_mount_opt, NOLOAD);
			break;
+5 −11
Original line number Diff line number Diff line
@@ -117,8 +117,8 @@ static void destroy_inodecache(void)

static int isofs_remount(struct super_block *sb, int *flags, char *data)
{
	/* we probably want a lot more here */
	*flags |= MS_RDONLY;
	if (!(*flags & MS_RDONLY))
		return -EROFS;
	return 0;
}

@@ -763,15 +763,6 @@ root_found:
	 */
	s->s_maxbytes = 0x80000000000LL;

	/*
	 * The CDROM is read-only, has no nodes (devices) on it, and since
	 * all of the files appear to be owned by root, we really do not want
	 * to allow suid.  (suid or devices will not show up unless we have
	 * Rock Ridge extensions)
	 */

	s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;

	/* Set this for reference. Its not currently used except on write
	   which we don't have .. */

@@ -1530,6 +1521,9 @@ struct inode *isofs_iget(struct super_block *sb,
static struct dentry *isofs_mount(struct file_system_type *fs_type,
	int flags, const char *dev_name, void *data)
{
	/* We don't support read-write mounts */
	if (!(flags & MS_RDONLY))
		return ERR_PTR(-EACCES);
	return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
}

+1 −1
Original line number Diff line number Diff line
@@ -340,13 +340,13 @@ void journal_commit_transaction(journal_t *journal)
	J_ASSERT(journal->j_committing_transaction == NULL);

	commit_transaction = journal->j_running_transaction;
	J_ASSERT(commit_transaction->t_state == T_RUNNING);

	trace_jbd_start_commit(journal, commit_transaction);
	jbd_debug(1, "JBD: starting commit of transaction %d\n",
			commit_transaction->t_tid);

	spin_lock(&journal->j_state_lock);
	J_ASSERT(commit_transaction->t_state == T_RUNNING);
	commit_transaction->t_state = T_LOCKED;

	trace_jbd_commit_locking(journal, commit_transaction);
+18 −0
Original line number Diff line number Diff line
@@ -90,6 +90,24 @@ static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
static void __journal_abort_soft (journal_t *journal, int errno);
static const char *journal_dev_name(journal_t *journal, char *buffer);

#ifdef CONFIG_JBD_DEBUG
void __jbd_debug(int level, const char *file, const char *func,
		 unsigned int line, const char *fmt, ...)
{
	struct va_format vaf;
	va_list args;

	if (level > journal_enable_debug)
		return;
	va_start(args, fmt);
	vaf.fmt = fmt;
	vaf.va = &args;
	printk(KERN_DEBUG "%s: (%s, %u): %pV\n", file, func, line, &vaf);
	va_end(args);
}
EXPORT_SYMBOL(__jbd_debug);
#endif

/*
 * Helper function used to manage commit timeouts
 */
Loading