1. 01 7月, 2015 30 次提交
  2. 12 4月, 2015 2 次提交
  3. 26 3月, 2015 1 次提交
  4. 19 3月, 2015 1 次提交
    • T
      fuse: explicitly set /dev/fuse file's private_data · 94e4fe2c
      Tom Van Braeckel 提交于
      The misc subsystem (which is used for /dev/fuse) initializes private_data to
      point to the misc device when a driver has registered a custom open file
      operation, and initializes it to NULL when a custom open file operation has
      *not* been provided.
      
      This subtle quirk is confusing, to the point where kernel code registers
      *empty* file open operations to have private_data point to the misc device
      structure. And it leads to bugs, where the addition or removal of a custom open
      file operation surprisingly changes the initial contents of a file's
      private_data structure.
      
      So to simplify things in the misc subsystem, a patch [1] has been proposed to
      *always* set the private_data to point to the misc device, instead of only
      doing this when a custom open file operation has been registered.
      
      But before this patch can be applied we need to modify drivers that make the
      assumption that a misc device file's private_data is initialized to NULL
      because they didn't register a custom open file operation, so they don't rely
      on this assumption anymore. FUSE uses private_data to store the fuse_conn and
      errors out if this is not initialized to NULL at mount time.
      
      Hence, we now set a file's private_data to NULL explicitly, to be independent
      of whatever value the misc subsystem initializes it to by default.
      
      [1] https://lkml.org/lkml/2014/12/4/939Reported-by: NGiedrius Statkevicius <giedriuswork@gmail.com>
      Reported-by: NThierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NTom Van Braeckel <tomvanbraeckel@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      94e4fe2c
  5. 26 2月, 2015 2 次提交
  6. 06 1月, 2015 2 次提交
    • M
      fuse: add memory barrier to INIT · 9759bd51
      Miklos Szeredi 提交于
      Theoretically we need to order setting of various fields in fc with
      fc->initialized.
      
      No known bug reports related to this yet.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      9759bd51
    • M
      fuse: fix LOOKUP vs INIT compat handling · 21f62174
      Miklos Szeredi 提交于
      Analysis from Marc:
      
       "Commit 7078187a ("fuse: introduce fuse_simple_request() helper")
        from the above pull request triggers some EIO errors for me in some tests
        that rely on fuse
      
        Looking at the code changes and a bit of debugging info I think there's a
        general problem here that fuse_get_req checks and possibly waits for
        fc->initialized, and this was always called first.  But this commit
        changes the ordering and in many places fc->minor is now possibly used
        before fuse_get_req, and we can't be sure that fc has been initialized.
        In my case fuse_lookup_init sets req->out.args[0].size to the wrong size
        because fc->minor at that point is still 0, leading to the EIO error."
      
      Fix by moving the compat adjustments into fuse_simple_request() to after
      fuse_get_req().
      
      This is also more readable than the original, since now compatibility is
      handled in a single function instead of cluttering each operation.
      Reported-by: NMarc Dionne <marc.c.dionne@gmail.com>
      Tested-by: NMarc Dionne <marc.c.dionne@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Fixes: 7078187a ("fuse: introduce fuse_simple_request() helper")
      21f62174
  7. 12 12月, 2014 1 次提交
    • M
      fuse: introduce fuse_simple_request() helper · 7078187a
      Miklos Szeredi 提交于
      The following pattern is repeated many times:
      
      	req = fuse_get_req_nopages(fc);
      	/* Initialize req->(in|out).args */
      	fuse_request_send(fc, req);
      	err = req->out.h.error;
      	fuse_put_request(req);
      
      Create a new replacement helper:
      
      	/* Initialize args */
      	err = fuse_simple_request(fc, &args);
      
      In addition to reducing the code size, this will ease moving from the
      complex arg-based to a simpler page-based I/O on the fuse device.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      7078187a
  8. 07 7月, 2014 1 次提交
    • M
      fuse: avoid scheduling while atomic · c55a01d3
      Miklos Szeredi 提交于
      As reported by Richard Sharpe, an attempt to use fuse_notify_inval_entry()
      triggers complains about scheduling while atomic:
      
        BUG: scheduling while atomic: fuse.hf/13976/0x10000001
      
      This happens because fuse_notify_inval_entry() attempts to allocate memory
      with GFP_KERNEL, holding "struct fuse_copy_state" mapped by kmap_atomic().
      
      Introduced by commit 58bda1da "fuse/dev: use atomic maps"
      
      Fix by moving the map/unmap to just cover the actual memcpy operation.
      
      Original patch from Maxim Patlasov <mpatlasov@parallels.com>
      Reported-by: NRichard Sharpe <realrichardsharpe@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: <stable@vger.kernel.org> # v3.15+
      c55a01d3