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

Commit be88751f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull misc filesystem updates from Jan Kara:
 "udf, ext2, quota, fsnotify fixes & cleanups:

   - udf fixes for handling of media without uid/gid

   - udf fixes for some corner cases in parsing of volume recognition
     sequence

   - improvements of fsnotify handling of ENOMEM

   - new ioctl to allow setting of watch descriptor id for inotify (for
     checkpoint - restart)

   - small ext2, reiserfs, quota cleanups"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: Kill an unused extern entry form quota.h
  reiserfs: Remove VLA from fs/reiserfs/reiserfs.h
  udf: fix potential refcnt problem of nls module
  ext2: change return code to -ENOMEM when failing memory allocation
  udf: Do not mark possibly inconsistent filesystems as closed
  fsnotify: Let userspace know about lost events due to ENOMEM
  fanotify: Avoid lost events due to ENOMEM for unlimited queues
  udf: Remove never implemented mount options
  udf: Update mount option documentation
  udf: Provide saner default for invalid uid / gid
  udf: Clean up handling of invalid uid/gid
  udf: Apply uid/gid mount options also to new inodes & chown
  udf: Ignore [ug]id=ignore mount options
  udf: Fix handling of Partition Descriptors
  udf: Unify common handling of descriptors
  udf: Convert descriptor index definitions to enum
  udf: Allow volume descriptor sequence to be terminated by unrecorded block
  udf: Simplify handling of Volume Descriptor Pointers
  udf: Fix off-by-one in volume descriptor sequence length
  inotify: Extend ioctl to allow to request id of new watch descriptor
parents 5e4d6597 b91ed9d8
Loading
Loading
Loading
Loading
+7 −19
Original line number Diff line number Diff line
@@ -36,18 +36,14 @@ The following mount options are supported:
	iocharset=	Set the NLS character set

The uid= and gid= options need a bit more explaining.  They will accept a
decimal numeric value which will be used as the default ID for that mount.
They will also accept the string "ignore" and "forget".  For files on the disk
that are owned by nobody ( -1 ), they will instead look as if they are owned
by the default ID.  The ignore option causes the default ID to override all
IDs on the disk, not just -1.  The forget option causes all IDs to be written
to disk as -1, so when the media is later remounted, they will appear to be
owned by whatever default ID it is mounted with at that time.
decimal numeric value and all inodes on that mount will then appear as
belonging to that uid and gid.  Mount options also accept the string "forget".
The forget option causes all IDs to be written to disk as -1 which is a way
of UDF standard to indicate that IDs are not supported for these files .

For typical desktop use of removable media, you should set the ID to that
of the interactively logged on user, and also specify both the forget and
ignore options.  This way the interactive user will always see the files
on the disk as belonging to him.
For typical desktop use of removable media, you should set the ID to that of
the interactively logged on user, and also specify the forget option.  This way
the interactive user will always see the files on the disk as belonging to him.

The remaining are for debugging and disaster recovery:

@@ -57,16 +53,8 @@ The following expect a offset from 0.

	session=	Set the CDROM session (default= last session)
	anchor=		Override standard anchor location. (default= 256)
	volume=		Override the VolumeDesc location. (unused)
	partition=	Override the PartitionDesc location. (unused)
	lastblock=	Set the last block of the filesystem/

The following expect a offset from the partition root.

	fileset=	Override the fileset block location. (unused)
	rootdir=	Override the root directory location. (unused)
			WARNING: overriding the rootdir to a non-directory may
				yield highly unpredictable results.
-------------------------------------------------------------------------------


+2 −2
Original line number Diff line number Diff line
@@ -827,7 +827,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
	unsigned long logic_sb_block;
	unsigned long offset = 0;
	unsigned long def_mount_opts;
	long ret = -EINVAL;
	long ret = -ENOMEM;
	int blocksize = BLOCK_SIZE;
	int db_count;
	int i, j;
@@ -835,7 +835,6 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
	int err;
	struct ext2_mount_options opts;

	err = -ENOMEM;
	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
	if (!sbi)
		goto failed;
@@ -851,6 +850,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
	sbi->s_daxdev = dax_dev;

	spin_lock_init(&sbi->s_lock);
	ret = -EINVAL;

	/*
	 * See what the current blocksize for the device is, and
+22 −6
Original line number Diff line number Diff line
@@ -139,23 +139,32 @@ static bool fanotify_should_send_event(struct fsnotify_mark *inode_mark,
	return false;
}

struct fanotify_event_info *fanotify_alloc_event(struct inode *inode, u32 mask,
struct fanotify_event_info *fanotify_alloc_event(struct fsnotify_group *group,
						 struct inode *inode, u32 mask,
						 const struct path *path)
{
	struct fanotify_event_info *event;
	gfp_t gfp = GFP_KERNEL;

	/*
	 * For queues with unlimited length lost events are not expected and
	 * can possibly have security implications. Avoid losing events when
	 * memory is short.
	 */
	if (group->max_events == UINT_MAX)
		gfp |= __GFP_NOFAIL;

	if (fanotify_is_perm_event(mask)) {
		struct fanotify_perm_event_info *pevent;

		pevent = kmem_cache_alloc(fanotify_perm_event_cachep,
					  GFP_KERNEL);
		pevent = kmem_cache_alloc(fanotify_perm_event_cachep, gfp);
		if (!pevent)
			return NULL;
		event = &pevent->fae;
		pevent->response = 0;
		goto init;
	}
	event = kmem_cache_alloc(fanotify_event_cachep, GFP_KERNEL);
	event = kmem_cache_alloc(fanotify_event_cachep, gfp);
	if (!event)
		return NULL;
init: __maybe_unused
@@ -210,10 +219,17 @@ static int fanotify_handle_event(struct fsnotify_group *group,
			return 0;
	}

	event = fanotify_alloc_event(inode, mask, data);
	event = fanotify_alloc_event(group, inode, mask, data);
	ret = -ENOMEM;
	if (unlikely(!event))
	if (unlikely(!event)) {
		/*
		 * We don't queue overflow events for permission events as
		 * there the access is denied and so no event is in fact lost.
		 */
		if (!fanotify_is_perm_event(mask))
			fsnotify_queue_overflow(group);
		goto finish;
	}

	fsn_event = &event->fse;
	ret = fsnotify_add_event(group, fsn_event, fanotify_merge);
+2 −1
Original line number Diff line number Diff line
@@ -52,5 +52,6 @@ static inline struct fanotify_event_info *FANOTIFY_E(struct fsnotify_event *fse)
	return container_of(fse, struct fanotify_event_info, fse);
}

struct fanotify_event_info *fanotify_alloc_event(struct inode *inode, u32 mask,
struct fanotify_event_info *fanotify_alloc_event(struct fsnotify_group *group,
						 struct inode *inode, u32 mask,
						 const struct path *path);
+1 −1
Original line number Diff line number Diff line
@@ -757,7 +757,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
	group->fanotify_data.user = user;
	atomic_inc(&user->fanotify_listeners);

	oevent = fanotify_alloc_event(NULL, FS_Q_OVERFLOW, NULL);
	oevent = fanotify_alloc_event(group, NULL, FS_Q_OVERFLOW, NULL);
	if (unlikely(!oevent)) {
		fd = -ENOMEM;
		goto out_destroy_group;
Loading