From: "J. Bruce Fields" <bfields@fieldses.org>
To: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: xfs@oss.sgi.com
Subject: Re: detecting case-insensitivity
Date: Mon, 9 Apr 2012 17:28:33 -0400 [thread overview]
Message-ID: <20120409212833.GA10508@fieldses.org> (raw)
In-Reply-To: <LBVkglc6jtb7.r3bLKBnl@host202.hostmonster.com>
> > From: Dave Chinner <david@fromorbit.com>
> > Date: 09.04.2012 03.30
> >
> > On Sat, Apr 07, 2012 at 10:00:29AM -0400, J. Bruce Fields wrote:
> > > Is there a generic way to detect whether a given filesystem is
> > > case-insensitive? If not, how should it be done? (A bit in s_flags?)
> >
> > I don't think there is a generic flag for it. We could trivially add
> > one, I think, as it is generally a fixed property for the entire
> > filesystem....
So, I assume the following is totally wrong, but the basic idea (create
a new flag, set it based on xfs_sb_version_hasasciici, check it in nfsd)
would work?
On Mon, Apr 09, 2012 at 09:01:11AM +0400, Vyacheslav Dubeyko wrote:
> But why does it need to detect that filesystem case-insensitive or not? In what use-case does it need to make such detection?
To be honest, I have no idea--it's not a mandatory attribute, so I think
I'll instead just ceasing to support the attribute and seeing if anyone
complains....
--b.
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index bcd8904..53f3044 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2233,7 +2233,7 @@ out_acl:
if (bmval0 & FATTR4_WORD0_CASE_INSENSITIVE) {
if ((buflen -= 4) < 0)
goto out_resource;
- WRITE32(1);
+ WRITE32(__IS_FLG(dentry->d_inode, MS_CASE_INSENSITIVE) ? 1 : 0);
}
if (bmval0 & FATTR4_WORD0_CASE_PRESERVING) {
if ((buflen -= 4) < 0)
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 7423d71..890f439 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1458,7 +1458,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
switch (createmode) {
case NFS3_CREATE_UNCHECKED:
if (! S_ISREG(dchild->d_inode->i_mode))
- err = nfserr_exist;
+ goto out;
else if (truncp) {
/* in nfsv4, we need to treat this case a little
* differently. we don't want to truncate the
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index ee5b695..6367817 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1343,6 +1343,8 @@ xfs_fs_fill_super(
sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits);
sb->s_time_gran = 1;
set_posix_acl_flag(sb);
+ if (xfs_sb_version_hasasciici(&mp->m_sb))
+ sb->s_flags |= MS_CASE_INSENSITIVE;
error = xfs_mountfs(mp);
if (error)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 8975a56..0ee6614 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -218,6 +218,8 @@ struct inodes_stat_t {
#define MS_BORN (1<<29)
#define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31)
+#define MS_CASE_INSENSITIVE (1<<32)
+
/*
* Superblock flags that can be altered by MS_REMOUNT
@@ -1421,7 +1423,7 @@ struct super_block {
const struct dquot_operations *dq_op;
const struct quotactl_ops *s_qcop;
const struct export_operations *s_export_op;
- unsigned long s_flags;
+ unsigned long long s_flags;
unsigned long s_magic;
struct dentry *s_root;
struct rw_semaphore s_umount;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-04-09 21:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 5:01 detecting case-insensitivity Vyacheslav Dubeyko
2012-04-09 21:28 ` J. Bruce Fields [this message]
2012-04-09 22:19 ` Dave Chinner
2012-04-09 22:27 ` J. Bruce Fields
2012-04-09 22:44 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2012-04-07 14:00 J. Bruce Fields
2012-04-08 23:02 ` Dave Chinner
2012-04-11 20:03 ` Christoph Hellwig
2012-04-11 20:37 ` J. Bruce Fields
2012-04-30 21:26 ` J. Bruce Fields
2012-04-30 23:01 ` Dave Chinner
2012-05-03 20:22 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120409212833.GA10508@fieldses.org \
--to=bfields@fieldses.org \
--cc=slava@dubeyko.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.